@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

/* ── Tokens — warm dark palette ──────────────── */
:root {
  --bg:         #171210;
  --surface:    #1e1813;
  --surface-2:  #241d16;
  --raise:      #241d16;
  --border:     rgba(236,229,220,.08);
  --border-2:   rgba(236,229,220,.15);
  --text:       #ece5dc;
  --muted:      #8f8378;
  --faint:      #63594e;
  --accent:     #a6c3a0;
  --accent-bg:  rgba(166,195,160,.12);
  --accent-bd:  rgba(166,195,160,.28);
  --shadow:     0 8px 32px rgba(0,0,0,.35);
  --shadow-lg:  0 24px 60px rgba(0,0,0,.5);
  --font:       'Vazirmatn', system-ui, Tahoma, sans-serif;
  --radius:     8px;
  --max-w:      1060px;
  --header-h:   78px;
}

/* ── Reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 2rem;   font-weight: 700; line-height: 1.3; }
h2 { font-size: 1.4rem; font-weight: 600; line-height: 1.4; }
h3 { font-size: 1.1rem; font-weight: 600; line-height: 1.5; }
p  { margin-bottom: 1rem; }

/* ── Layout ──────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ─────────────────────────────────────────────
   HEADER
───────────────────────────────────────────── */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Brand: lamp button + name link side by side */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

/* Lamp toggle button (header) */
.lamp-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 24px;
  font-family: inherit;
}
.lamp-shade-top {
  width: 20px;
  height: 10px;
  display: block;
  clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
  background: var(--accent);
  transition: background .25s;
}
[data-lamp="off"] .lamp-shade-top { background: #5a4936; }
.lamp-pole {
  width: 2px;
  height: 9px;
  background: #5a4936;
  display: block;
}
.lamp-base-bar {
  width: 13px;
  height: 3px;
  background: #5a4936;
  border-radius: 2px 2px 0 0;
  display: block;
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.brand-name:hover { color: var(--accent); text-decoration: none; }

.site-nav { display: flex; gap: 26px; align-items: center; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 1px;
  transition: transform .2s, opacity .2s;
}
.site-header.is-nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.is-nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.site-header.is-nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

body.nav-open { overflow: hidden; }

.site-nav a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.site-nav a:hover  { color: var(--text); text-decoration: none; }
.site-nav a.active { color: var(--accent); font-weight: 600; }

/* ── Main / Footer ───────────────────────────── */
main { padding: 0; }

.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 1.875rem 0;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-brand { color: var(--faint); font-size: 0.8rem; }
.footer-domain { color: var(--faint); font-size: 0.8rem; }

/* ── Shared components ───────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost   { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-ghost:hover { background: var(--accent-bg); }

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--accent-bg);
  color: var(--accent);
}

.callout {
  background: var(--accent-bg);
  border-right: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.4rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.7;
}
.callout strong { color: var(--text); font-weight: 600; }

/* ─────────────────────────────────────────────
   HOME — HERO
───────────────────────────────────────────── */
.home-hero-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 72px 1.5rem 60px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 48px;
  align-items: center;
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.28;
  margin-bottom: 20px;
}
.hero-title-accent { color: var(--accent); }

.hero-desc {
  max-width: 480px;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 1.1rem;
}

.cta-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-text {
  background: transparent;
  color: var(--text);
  padding: 13px 10px;
}
.btn-text:hover { color: var(--accent); opacity: 1; transform: none; }

.home-featured-book {
  position: relative;
  display: flex;
  justify-content: center;
}

.featured-book-cover {
  width: 200px;
  aspect-ratio: 3/4;
  border-radius: 12px;
  background: #3a2a1d;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  transform: rotate(-3deg);
  position: relative;
}
.featured-book-icon { position: absolute; top: 16px; inset-inline-end: 18px; font-size: 1.8rem; }
.featured-book-title { font-weight: 700; font-size: 1.15rem; color: #3a2318; line-height: 1.5; }
.featured-book-author { font-size: 0.85rem; color: #7a5140; margin-top: 4px; }

.featured-book-badge {
  position: absolute;
  bottom: -14px;
  inset-inline-start: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

@media (max-width: 900px) {
  .home-hero-grid { grid-template-columns: 1fr; padding-top: 48px; }
  .home-featured-book { justify-content: flex-start; margin-top: 8px; }
}
@media (max-width: 600px) {
  .hero-title { font-size: 2.1rem; }
}

/* ─────────────────────────────────────────────
   HOME — LIBRARY PREVIEW
───────────────────────────────────────────── */
.preview-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 1.5rem 64px;
}

.preview-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.preview-header h2    { font-size: 1.55rem; font-weight: 700; margin-bottom: 4px; }
.preview-header p     { color: var(--muted); font-size: 0.95rem; margin: 0; }
.preview-header a     { flex-shrink: 0; font-weight: 600; font-size: 0.92rem; }
.preview-header a:hover { text-decoration: none; opacity: 0.8; }

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 860px) { .preview-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .preview-grid { grid-template-columns: 1fr; } }

/* ─────────────────────────────────────────────
   HOME — PET FEATURE DEFINITION
───────────────────────────────────────────── */
.pf-definition-section {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 64px 0;
}

.pf-definition-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}
.pf-definition-inner h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 16px; }
.pf-definition-inner p  { color: var(--muted); font-size: 1.05rem; line-height: 1.9; margin-bottom: 22px; }

.pf-definition-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  transition: gap 0.15s;
}
.pf-definition-link:hover { gap: 12px; text-decoration: none; }

/* ─────────────────────────────────────────────
   HOME v5 — SHELF HERO
───────────────────────────────────────────── */
.home-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.home-hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 55% 60% at 28% 72%, rgba(166,195,160,.13), transparent 70%);
  transition: opacity .3s;
}
[data-lamp="off"] .home-hero-glow { opacity: 0; }

.home-hero-inner {
  position: relative;
  max-width: 1060px;
  margin: 0 auto;
  padding: 64px 28px 0;
}
.home-hero-inner h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.45;
}
.home-hero-accent { color: var(--accent); }
.home-hero-desc {
  margin-top: 22px;
  font-size: 1.02rem;
  color: var(--muted);
  max-width: 480px;
  line-height: 2.1;
}
.home-hero-cta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
  flex-wrap: wrap;
}
.home-hero-count { font-size: .85rem; color: var(--faint); }

/* Shelf container */
.home-shelf {
  position: relative;
  max-width: 1060px;
  margin: 0 auto;
  padding: 64px 28px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.home-shelf::-webkit-scrollbar { display: none; }

.home-shelf-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 0 12px;
  min-width: min-content;
}
.home-shelf-ledge {
  height: 12px;
  background: linear-gradient(180deg, #3a2d20, #241b12);
  border-radius: 2px;
  box-shadow: 0 10px 26px rgba(0,0,0,.55);
  min-width: min-content;
}
.home-shelf-hint {
  position: relative;
  max-width: 1060px;
  margin: 0 auto;
  padding: 14px 28px 64px;
  font-size: .78rem;
  color: var(--faint);
}

/* Shelf lamp */
.home-shelf-lamp {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-inline-end: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 196px;
  position: relative;
  font-family: var(--font);
}
.home-shelf-lamp-cone {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 190px;
  height: 104px;
  display: block;
  pointer-events: none;
  clip-path: polygon(34% 0, 66% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 28%, transparent), transparent);
  transition: opacity .3s;
}
[data-lamp="off"] .home-shelf-lamp-cone { opacity: 0; }
.home-shelf-lamp-shade {
  width: 66px;
  height: 32px;
  display: block;
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, #4a3a28, var(--accent));
  transition: background .25s;
}
[data-lamp="off"] .home-shelf-lamp-shade { background: linear-gradient(180deg, #33291d, #453626); }
.home-shelf-lamp-pole { width: 4px; height: 92px; background: #3d3125; display: block; }
.home-shelf-lamp-base { width: 44px; height: 9px; background: #3d3125; border-radius: 5px 5px 0 0; display: block; }

/* Book spines */
.home-spine {
  flex-shrink: 0;
  border-radius: 3px 3px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-decoration: none;
  transition: transform .18s ease;
  box-shadow: inset -3px 0 6px rgba(0,0,0,.28), inset 1px 0 0 rgba(236,229,220,.06);
}
.home-spine:hover { transform: translateY(-10px); text-decoration: none; }
.home-spine-label {
  writing-mode: vertical-rl;
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(236,229,220,.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─────────────────────────────────────────────
   HOME v5 — ABOUT PET FEATURE
───────────────────────────────────────────── */
.home-about {
  border-top: 1px solid var(--border);
}
.home-about-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 64px 28px;
}
.home-about-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--accent);
}
.home-about-eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
  display: block;
}
.home-about-body {
  font-size: 1.35rem;
  font-weight: 300;
  color: var(--text);
  line-height: 2.2;
  max-width: 760px;
  margin: 0;
}

/* ─────────────────────────────────────────────
   HOME v5 — WRITING + TOOLS
───────────────────────────────────────────── */
.home-content { border-top: 1px solid var(--border); }
.home-cols {
  max-width: 1060px;
  margin: 0 auto;
  padding: 68px 28px 92px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 80px;
  align-items: start;
}
@media (max-width: 860px) {
  .home-hero-inner h1 { font-size: 2.2rem; }
  .home-cols { grid-template-columns: 1fr; gap: 56px; }
}
.home-cols-heading {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 20px;
}

/* Post list */
.home-post-list { display: flex; flex-direction: column; }
.home-post-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: color .15s;
}
.home-post-row:hover { color: var(--accent); text-decoration: none; }
.home-post-title { font-size: 1.05rem; font-weight: 600; line-height: 1.7; }
.home-post-meta  { font-size: .78rem; color: var(--faint); }
.home-posts-more {
  display: inline-block;
  margin-top: 22px;
  font-size: .88rem;
  color: var(--accent);
  text-decoration: none;
}
.home-posts-more:hover { text-decoration: none; opacity: .8; }

/* Tool cards */
.home-tool-list { display: flex; flex-direction: column; gap: 12px; }
.home-tool-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, background .15s;
}
.home-tool-card:hover { border-color: var(--border-2); background: var(--raise); text-decoration: none; }
.home-tool-name { font-size: .98rem; font-weight: 600; }
.home-tool-desc { font-size: .8rem; color: var(--muted); line-height: 1.8; }

/* ── HOME: Roadmap ladder ────────────────────────────────────────────────── */
.home-roadmap { border-top: 1px solid var(--border); }
.home-roadmap-inner { max-width: 1120px; margin: 0 auto; padding: 56px 1.5rem 72px; }
.home-roadmap-eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.home-roadmap-line { width: 24px; height: 1px; background: var(--accent); display: block; flex-shrink: 0; }
.home-roadmap-eyebrow-label { font-size: 12px; font-weight: 600; letter-spacing: .1em; color: var(--accent); }
.home-roadmap-header { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.home-roadmap-title { font-size: 1.7rem; font-weight: 800; }
.home-roadmap-hint { font-size: .8rem; color: var(--faint); }
.home-roadmap-desc { font-size: .95rem; color: var(--muted); max-width: 700px; line-height: 2.1; margin-bottom: 28px; }
.home-roadmap-more { display: inline-block; margin-top: 20px; font-size: .88rem; color: var(--accent); text-decoration: none; }
.home-roadmap-more:hover { text-decoration: none; opacity: .8; color: var(--accent); }
.home-roadmap-note { font-size: .85rem; color: var(--faint); line-height: 2; margin-top: 14px; }

/* Ladder rungs */
.home-ladder { position: relative; border-inline-end: 1px solid var(--border-2); }
.home-ladder-rung { position: relative; display: flex; justify-content: flex-start; padding: 7px 0; }
.home-ladder-tick {
  position: absolute; inset-inline-end: 0; top: 50%; height: 1px; display: block;
  background: linear-gradient(to left, color-mix(in srgb, var(--accent) 40%, transparent), transparent);
}
.home-ladder-tick--green { background: linear-gradient(to left, rgba(143,191,134,.45), transparent); }
.home-ladder-card {
  flex: 1; min-width: 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  text-decoration: none; color: inherit;
  background: rgba(217,160,95,.06);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 12px; padding: 16px 20px;
  transition: border-color .18s, background .18s;
}
.home-ladder-card--active:hover {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: rgba(217,160,95,.1);
  text-decoration: none; color: inherit;
}
.home-ladder-card--soon { opacity: .4; cursor: default; pointer-events: none; }
.home-ladder-card--hiring {
  background: rgba(143,191,134,.06);
  border: 1px dashed rgba(143,191,134,.4);
}
.home-ladder-card--hiring:hover {
  border-color: rgba(143,191,134,.6);
  background: rgba(143,191,134,.1);
  text-decoration: none; color: inherit;
}
.home-ladder-card-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.home-ladder-num {
  width: 26px; height: 26px; border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; flex-shrink: 0;
}
.home-ladder-num--green { background: rgba(143,191,134,.16); color: #8fbf86; }
.home-ladder-fa { font-size: 1.05rem; font-weight: 700; line-height: 1.6; }
.home-ladder-en { font-size: .76rem; color: var(--faint); }
.home-ladder-badge {
  font-size: .7rem; color: var(--faint);
  background: rgba(236,229,220,.05);
  border: 1px dashed var(--border-2);
  border-radius: 6px; padding: 3px 10px;
}
.home-ladder-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.home-ladder-chip { font-size: .76rem; border-radius: 6px; padding: 4px 10px; white-space: nowrap; }
.home-ladder-chip--amber { color: var(--accent); background: color-mix(in srgb, var(--accent) 11%, transparent); }
.home-ladder-chip--muted { color: var(--muted); background: rgba(236,229,220,.05); }
.home-ladder-chip--green { color: #8fbf86; background: rgba(143,191,134,.11); }
.home-ladder-arrow { color: var(--faint); font-size: .9rem; }

@media (max-width: 760px) {
  .home-ladder-rung { padding-inline-end: 0 !important; }
  .home-ladder-tick { display: none !important; }
  .home-ladder-card { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ─────────────────────────────────────────────
   BOOK CARDS (shared: home preview + library)
───────────────────────────────────────────── */
.book-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
}
.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
  border-color: #d5ccc3;
  text-decoration: none;
}

.book-cover {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

.book-card:nth-child(6n+1) .book-cover { background: #3a2a1d; }
.book-card:nth-child(6n+2) .book-cover { background: #4a3323; }
.book-card:nth-child(6n+3) .book-cover { background: #2e2318; }
.book-card:nth-child(6n+4) .book-cover { background: #5c3f28; }
.book-card:nth-child(6n+5) .book-cover { background: #42301f; }
.book-card:nth-child(6n+0) .book-cover { background: #37281a; }

.book-cover-icon { font-size: 2.6rem; opacity: 0.92; position: relative; z-index: 1; }

.book-info {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.book-title  { font-size: 1rem; font-weight: 600; margin-bottom: 4px; line-height: 1.45; }
.book-author { font-size: 0.84rem; color: var(--muted); margin-bottom: 14px; }
.book-tags   { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }

/* ─────────────────────────────────────────────
   LIBRARY PAGE
───────────────────────────────────────────── */

/* Hero section */
.library-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

/* Ambient glow behind desk (lamp-on state) */
.lib-hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 65% at 74% 68%, rgba(166,195,160,.13), transparent 70%);
  pointer-events: none;
  transition: opacity .3s;
}
[data-lamp="off"] .lib-hero-glow { opacity: 0; }

.lib-hero-grid {
  position: relative;
  padding: 64px 1.5rem 0;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 44px;
  align-items: end;
}
@media (max-width: 900px) {
  .lib-hero-grid { grid-template-columns: 1fr; padding-bottom: 32px; }
  .lib-desk-scene { display: none; }
}

.lib-hero-copy { padding-bottom: 56px; }

.library-hero h1 {
  font-size: 2.9rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.5;
  margin-bottom: 20px;
}
.library-hero-desc {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 2.1;
  max-width: 520px;
  margin: 0 0 18px;
}
.lib-suggest-line {
  font-size: .85rem;
  color: var(--faint);
  margin: 0;
}
.lib-suggest-line a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(166,195,160,.35);
  padding-bottom: 1px;
}
.lib-suggest-line a:hover { text-decoration: none; border-bottom-color: var(--accent); }
@media (max-width: 560px) { .library-hero h1 { font-size: 2.1rem; } }

/* ── Desk scene (library hero right column) ── */
.lib-desk-scene {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.lib-desk-items {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 22px;
  padding: 0 26px;
  justify-content: center;
  transition: filter .3s;
}
[data-lamp="off"] .lib-desk-items { filter: brightness(.55); }

/* Desk lamp (big, inside hero) */
.lib-desk-lamp {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 186px;
  position: relative;
  font-family: inherit;
}
.lib-lamp-cone {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 210px;
  height: 100px;
  display: block;
  pointer-events: none;
  clip-path: polygon(36% 0, 64% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(166,195,160,.28), transparent);
  transition: opacity .3s;
}
[data-lamp="off"] .lib-lamp-cone { opacity: 0; }
.lib-lamp-shade {
  width: 62px;
  height: 30px;
  display: block;
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, #4a3a28, var(--accent));
  transition: background .25s;
}
[data-lamp="off"] .lib-lamp-shade { background: linear-gradient(180deg, #33291d, #453626); }
.lib-lamp-pole { width: 4px; height: 86px; background: #3d3125; display: block; }
.lib-lamp-foot { width: 42px; height: 9px; background: #3d3125; border-radius: 5px 5px 0 0; display: block; }

/* Book stack */
.lib-book-stack {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
.lib-book-stack span {
  border-radius: 3px;
  display: block;
}

/* Desk surface + legs */
.lib-desk-surface {
  position: relative;
  height: 14px;
  background: linear-gradient(180deg, #3a2d20, #241b12);
  border-radius: 3px;
  box-shadow: 0 12px 28px rgba(0,0,0,.55);
}
.lib-desk-legs {
  display: flex;
  justify-content: space-between;
  padding: 0 26px;
}
.lib-desk-legs span {
  width: 8px;
  height: 42px;
  background: #241b12;
  display: block;
}

/* ── Sticky filter bar ─────────────────────── */
.lib-filter-sticky {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--header-h);
  z-index: 10;
  background: rgba(23,18,16,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.lib-filter-sticky .container {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.lib-count {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.filter-strip {
  display: flex;
  gap: 0;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  height: 100%;
  align-items: stretch;
}
.filter-strip::-webkit-scrollbar { display: none; }

.filter-pill {
  flex-shrink: 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0 8px;
  font-family: var(--font);
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 400;
  transition: color .15s;
  display: flex;
  align-items: center;
}
.filter-pill:hover { color: var(--text); text-decoration: none; }
.filter-pill.active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }

/* ── Legacy filter row (tools/blog — will be updated per page) ── */
.lib-filter-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.library-stat {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  border: 1px solid var(--accent-bd);
}
.lib-filter-divider { flex-shrink: 0; width: 1px; height: 22px; background: var(--border); }

/* ── Book grid ─────────────────────────────── */
.library-body { padding: 52px 0 92px; }

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .book-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .book-grid { grid-template-columns: 1fr; } }

.lib-book-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  display: flex;
  gap: 16px;
  padding: 18px;
  align-items: flex-start;
  transition: border-color .15s, background .15s;
}
.lib-book-card[hidden] { display: none; }
.lib-book-card:hover {
  border-color: var(--border-2);
  background: var(--raise);
  text-decoration: none;
}

.lib-book-cover {
  width: 54px;
  aspect-ratio: 3/4;
  border-radius: 2px 4px 4px 2px;
  box-shadow: inset -4px 0 8px rgba(0,0,0,.3), inset 2px 0 0 rgba(166,195,160,.4);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.lib-book-cover img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

/* Dark warm fallback colors per nth-child */
.lib-book-card:nth-child(6n+1) .lib-book-cover { background: #3a2a1d; }
.lib-book-card:nth-child(6n+2) .lib-book-cover { background: #4a3323; }
.lib-book-card:nth-child(6n+3) .lib-book-cover { background: #2e2318; }
.lib-book-card:nth-child(6n+4) .lib-book-cover { background: #5c3f28; }
.lib-book-card:nth-child(6n+5) .lib-book-cover { background: #42301f; }
.lib-book-card:nth-child(6n+0) .lib-book-cover { background: #37281a; }

.lib-book-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}
.lib-book-title  { font-size: 1rem; font-weight: 600; margin-bottom: 3px; line-height: 1.55; }
.lib-book-author { font-size: .8rem; color: var(--muted); }
.lib-book-cover .book-cover-icon { font-size: 1.2rem; position: relative; z-index: 1; }

.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 5rem 1rem;
  text-align: center;
}
.empty-state[hidden] { display: none; }
.empty-icon { font-size: 3.5rem; opacity: 0.35; line-height: 1; }
.empty-state h3 { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.empty-state p  { color: var(--muted); font-size: 0.95rem; max-width: 340px; margin: 0; }

/* ─────────────────────────────────────────────
   BOOK DETAIL
───────────────────────────────────────────── */
.book-detail-page { padding: 40px 0 92px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: var(--faint);
  margin-bottom: 40px;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: none; }

.book-detail-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 860px) {
  .book-detail-layout { grid-template-columns: 1fr; }
  .book-detail-aside  { position: static !important; }
}

.book-detail-aside {
  position: sticky;
  top: calc(var(--header-h) + 32px);
}

/* ── Shelf card (aside) ───────────────────── */
.bd2-shelf {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 30px 24px 0;
}
.bd2-shelf-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 70% at 50% 75%, rgba(166,195,160,.12), transparent 75%);
  transition: opacity .3s;
}
[data-lamp="off"] .bd2-shelf-glow { opacity: 0; }

.bd2-shelf-items {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 20px;
  transition: filter .3s;
}
[data-lamp="off"] .bd2-shelf-items { filter: brightness(.55); }

.bd2-book-standing {
  width: 118px;
  height: 170px;
  border-radius: 3px 6px 6px 3px;
  background: #4a3323;
  box-shadow: 0 10px 24px rgba(0,0,0,.45);
  overflow: hidden;
  flex-shrink: 0;
}
.bd2-book-standing img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bd2-book-standing .book-cover-icon { font-size: 2.5rem; display: flex; align-items: center; justify-content: center; height: 100%; }

/* Small lamp on the shelf */
.bd2-shelf-lamp {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 120px;
  position: relative;
  font-family: inherit;
}
.bd2-lamp-cone {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 66px;
  display: block;
  pointer-events: none;
  clip-path: polygon(36% 0, 64% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(166,195,160,.28), transparent);
  transition: opacity .3s;
}
[data-lamp="off"] .bd2-lamp-cone { opacity: 0; }
.bd2-lamp-shade {
  width: 44px;
  height: 21px;
  display: block;
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, #4a3a28, var(--accent));
  transition: background .25s;
}
[data-lamp="off"] .bd2-lamp-shade { background: linear-gradient(180deg, #33291d, #453626); }
.bd2-lamp-pole { width: 3px; height: 52px; background: #3d3125; display: block; }
.bd2-lamp-foot { width: 30px; height: 7px; background: #3d3125; border-radius: 4px 4px 0 0; display: block; }

.bd2-shelf-surface {
  position: relative;
  height: 10px;
  background: linear-gradient(180deg, #3a2d20, #241b12);
  border-radius: 3px 3px 0 0;
}

/* Meta list below shelf */
.bd2-meta-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 6px 0;
}
.bd2-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: .82rem;
  color: var(--muted);
}
.bd2-meta-key { color: var(--faint); flex-shrink: 0; }

/* ── Main content ─────────────────────────── */
.book-detail-header { margin-bottom: 30px; }
.book-detail-header h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.4; margin-bottom: 8px; }
.book-detail-subtitle { font-size: 1.08rem; color: var(--muted); margin-bottom: 6px; }
.book-detail-author   { font-size: .9rem; color: var(--faint); margin-bottom: 0; }
.book-detail-author strong { font-weight: 600; color: var(--text); }
.book-detail-tags     { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Actions row — buy + download + rating inline */
.book-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.bd2-btn-buy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #171210;
  font-weight: 700;
  font-size: 14px;
  padding: 11px 24px;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity .15s;
}
.bd2-btn-buy:hover { opacity: .88; text-decoration: none; color: #171210; }

.bd2-btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid rgba(166,195,160,.4);
  padding-bottom: 2px;
}
.bd2-btn-download:hover { text-decoration: none; border-bottom-color: var(--accent); }

/* Inline star rating in actions row */
.bd2-rating-inline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-inline-start: auto;
}
.bd2-stars {
  display: flex;
  gap: 2px;
  direction: ltr;
  border: none;
  background: none;
  padding: 0;
}
.bd2-star-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 1px;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--faint);
  font-family: inherit;
  transition: color .15s;
}
/* .filled is toggled by JS on hover / submit */
.bd2-star-btn.filled { color: var(--accent); }
.bd2-rating-label { font-size: .78rem; color: var(--faint); white-space: nowrap; }

/* Section header: line + label */
.book-section               { margin-bottom: 44px; }
.book-section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--accent);
}
.book-section-label::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
  display: block;
}
.book-note { font-size: 1.04rem; line-height: 2.1; }

/* Quotes — open quote decoration */
.quote-list { list-style: none; display: flex; flex-direction: column; gap: 20px; }
.quote-item {
  position: relative;
  padding: 2px 34px 2px 0;
  font-size: 1.02rem;
  color: var(--text);
  line-height: 2;
  font-weight: 300;
  background: none;
  border: none;
  border-radius: 0;
  font-style: normal;
}
.quote-item::before {
  content: '"';
  position: absolute;
  right: 0;
  top: -6px;
  font-size: 1.9rem;
  color: var(--accent);
  line-height: 1;
  font-weight: 700;
}

.richtext-content { overflow-wrap: break-word; word-break: break-word; }
.richtext-content p          { margin-bottom: 1.1rem; }
.richtext-content p:last-child { margin-bottom: 0; }
.richtext-content ul,
.richtext-content ol         { padding-right: 1.5rem; margin-bottom: 1.1rem; }
.richtext-content li         { margin-bottom: 0.35rem; }
.richtext-content a          { color: var(--accent); text-decoration: underline; }
.richtext-content blockquote {
  border-right: 3px solid var(--accent);
  padding: 0.75rem 1.1rem;
  background: var(--accent-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
  font-style: italic;
  margin: 1.1rem 0;
}

/* Responsive video embeds (YouTube, Vimeo, mp4) */
.richtext-content .richtext-video {
  position: relative;
  width: 100%;
  max-width: 100%;
  padding-top: 56.25%;
  margin: 1.25rem 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--raise, #1a1510);
}
.richtext-content .richtext-video iframe,
.richtext-content .richtext-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  border: none;
  object-fit: contain;
  display: block;
}
/* Legacy / unwrapped video tags in saved HTML */
.richtext-content > video,
.richtext-content p > video {
  max-width: 100%;
  width: 100%;
  height: auto;
  display: block;
  margin: 1.25rem 0;
  border-radius: 8px;
}
.richtext-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem 0;
  border-radius: 8px;
}

/* Media/resource list — flat row style */
.resource-list { list-style: none; display: flex; flex-direction: column; }
.resource-item {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 15px 4px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  border-radius: 0;
  transition: background .15s;
  text-decoration: none;
  color: inherit;
}
.resource-item:hover { background: var(--surface); text-decoration: none; }
.resource-kind {
  flex-shrink: 0;
  width: 56px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--accent);
}
.resource-title { font-weight: 500; font-size: .96rem; flex: 1; }
.resource-link  { flex-shrink: 0; font-size: .8rem; color: var(--faint); text-decoration: none; }
.resource-link:hover { color: var(--accent); text-decoration: none; }

/* Referred books */
.referred-section   { padding-top: 32px; border-top: 1px solid var(--border); margin-bottom: 44px; }
.referred-books-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 560px) { .referred-books-grid { grid-template-columns: 1fr; } }

.referred-book-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: inherit;
  transition: border-color .15s, background .15s;
}
.referred-book-card:hover { border-color: var(--border-2); background: var(--raise); text-decoration: none; }

.referred-book-cover {
  width: 40px;
  height: 54px;
  border-radius: 2px 3px 3px 2px;
  background: #3a2a1d;
  box-shadow: inset -3px 0 6px rgba(0,0,0,.3), inset 2px 0 0 rgba(166,195,160,.4);
  flex-shrink: 0;
  overflow: hidden;
  display: block;
}
.referred-book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.referred-book-title  { display: block; font-size: .94rem; font-weight: 600; margin-bottom: 2px; }
.referred-book-author { display: block; font-size: .8rem; color: var(--muted); }

/* Comments section in book detail */
.bd2-comment-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.bd2-comment-head { display: flex; align-items: baseline; gap: 12px; }
.bd2-comment-name { font-size: .9rem; font-weight: 600; }
.bd2-comment-date { font-size: .75rem; color: var(--faint); }
.bd2-comment-body { font-size: .95rem; color: var(--muted); line-height: 2; margin: 0; }

.comment-reply {
  margin-top: 10px;
  margin-right: 24px;
  padding: 10px 14px;
  background: var(--accent-bg);
  border-right: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}
.comment-reply-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.comment-reply-author { font-size: .82rem; font-weight: 700; color: var(--accent); }
.comment-reply-date { font-size: .72rem; color: var(--faint); }
.comment-reply-body { font-size: .88rem; color: var(--text); line-height: 1.85; margin: 0; }

/* ─────────────────────────────────────────────
   BLOG LIST
───────────────────────────────────────────── */

/* Hero — lamp on a side table, glow on the right */
.blog-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.blog-hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 45% 70% at 80% 70%, rgba(166,195,160,.14), transparent 70%);
  transition: opacity .3s;
}
[data-lamp="off"] .blog-hero-glow { opacity: 0; }

.blog-hero-inner {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 64px 1.5rem 56px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.blog-hero h1 {
  font-size: 2.9rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.5;
  margin-bottom: 18px;
}
.blog-hero-desc {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 2.1;
  max-width: 520px;
  margin: 0;
}

/* Side table lamp (blog hero) */
.blog-lamp-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  transition: filter .3s;
}
[data-lamp="off"] .blog-lamp-scene { filter: brightness(.55); }

.blog-lamp-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 158px;
  position: relative;
  font-family: inherit;
}
.blog-lamp-cone {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 86px;
  display: block;
  pointer-events: none;
  clip-path: polygon(36% 0, 64% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(166,195,160,.28), transparent);
  transition: opacity .3s;
}
[data-lamp="off"] .blog-lamp-cone { opacity: 0; }
.blog-lamp-shade {
  width: 56px;
  height: 27px;
  display: block;
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, #4a3a28, var(--accent));
  transition: background .25s;
}
[data-lamp="off"] .blog-lamp-shade { background: linear-gradient(180deg, #33291d, #453626); }
.blog-lamp-pole { width: 4px; height: 70px; background: #3d3125; display: block; }
.blog-lamp-foot { width: 38px; height: 8px; background: #3d3125; border-radius: 5px 5px 0 0; display: block; }

.blog-side-table {
  width: 150px;
}
.blog-side-table-surface {
  height: 11px;
  background: linear-gradient(180deg, #3a2d20, #241b12);
  border-radius: 3px;
  box-shadow: 0 10px 24px rgba(0,0,0,.5);
}
.blog-side-table-legs {
  display: flex;
  justify-content: space-between;
  padding: 0 16px;
}
.blog-side-table-legs span {
  width: 7px;
  height: 30px;
  background: #241b12;
  display: block;
}

@media (max-width: 860px) {
  .blog-hero h1 { font-size: 2.1rem; }
  .blog-lamp-scene { display: none; }
}

/* ── Flat post list ───────────────────────── */
.blog-body { padding: 56px 0 92px; }

.blog-post-list { display: flex; flex-direction: column; }

.blog-post-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 28px;
  align-items: baseline;
  padding: 24px 4px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.blog-post-row:hover { background: var(--surface); text-decoration: none; }

.blog-post-date {
  font-size: .78rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.blog-post-body { display: flex; flex-direction: column; gap: 4px; }
.blog-post-title { font-size: 1.12rem; font-weight: 600; line-height: 1.7; }
.blog-post-excerpt { font-size: .85rem; color: var(--muted); line-height: 1.9; }
.blog-post-tag { font-size: .75rem; color: var(--accent); flex-shrink: 0; }

@media (max-width: 640px) {
  .blog-post-row { grid-template-columns: 1fr auto; gap: 12px; }
  .blog-post-date { display: none; }
}

/* ─────────────────────────────────────────────
   POST DETAIL
───────────────────────────────────────────── */
.post-detail-wrap {
  position: relative;
}
/* Ambient reading glow at the top */
.post-reading-glow {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 320px;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 30% at 50% 0%, rgba(166,195,160,.08), transparent 75%);
  transition: opacity .3s;
}
[data-lamp="off"] .post-reading-glow { opacity: 0; }

.post-detail-page {
  position: relative;
  max-width: 720px;
  padding: 44px 1.5rem 92px;
  margin: 0 auto;
}

.post-detail-header { margin-bottom: 36px; }
.post-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--accent);
}
.post-eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
  display: block;
}
.post-title {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.55;
  margin-bottom: 18px;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
  color: var(--faint);
  flex-wrap: wrap;
}
.post-meta .post-meta-author { color: var(--muted); }

.post-cover {
  height: 240px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 40px;
  border: 1px solid var(--border);
  background: #2e2318;
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-cover-placeholder {
  background: repeating-linear-gradient(
    45deg,
    var(--surface) 0 14px,
    var(--raise)   14px 28px
  );
}

.post-body {
  font-size: 1.06rem;
  line-height: 2.15;
  font-weight: 300;
  max-width: 100%;
  overflow-x: clip;
}
/* Blockquotes inside post body use open-quote style */
.post-body blockquote,
.richtext-content blockquote {
  position: relative;
  padding: 2px 36px 2px 0;
  margin: 34px 0;
  font-size: 1.12rem;
  color: var(--text);
  line-height: 2;
  font-weight: 300;
  background: none;
  border: none;
  border-radius: 0;
  font-style: normal;
}
.post-body blockquote::before,
.richtext-content blockquote::before {
  content: '"';
  position: absolute;
  right: 0;
  top: -8px;
  font-size: 2.2rem;
  color: var(--accent);
  line-height: 1;
  font-weight: 700;
}
.post-body h2 { font-size: 1.3rem; font-weight: 700; margin: 40px 0 18px; }
.post-body p  { margin-bottom: 24px; }

/* Action bar: rating + copy link */
.post-action-bar {
  margin-top: 52px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.post-rating-side { display: flex; align-items: center; gap: 14px; }
.post-rating-stat { font-size: .78rem; color: var(--faint); white-space: nowrap; }
.post-copy-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font);
  font-size: .82rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.post-copy-btn:hover { border-color: var(--border-2); color: var(--text); }

/* Comments */
.comments-section { padding-top: 36px; margin-top: 44px; border-top: 1px solid var(--border); }
.comments-list { display: flex; flex-direction: column; gap: 22px; margin-bottom: 34px; }

.comment-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-hint { font-size: 0.85rem; color: var(--muted); }
.form-success {
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--accent-bd);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}
.comment-form-title { font-weight: 600; font-size: .92rem; }
.comment-form .form-control {
  width: 100%;
  font-family: var(--font);
  font-size: .88rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  transition: border-color .15s;
}
.comment-form .form-control:focus { outline: none; border-color: var(--border-2); }
.comment-form textarea.form-control { resize: vertical; line-height: 1.9; }
.comment-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.post-footer-nav { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.post-back-link { color: var(--accent); font-weight: 600; font-size: .92rem; text-decoration: none; }
.post-back-link:hover { text-decoration: none; opacity: .8; }

@media (max-width: 700px) {
  .post-title { font-size: 1.8rem; }
  .post-cover { height: 180px; }
}

/* ─────────────────────────────────────────────
   TOOLS LIST
───────────────────────────────────────────── */
/* Hero */
.tools-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.tools-hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 45% 70% at 80% 70%, rgba(166,195,160,.12), transparent 70%);
  transition: opacity .3s;
}
[data-lamp="off"] .tools-hero-glow { opacity: 0; }

.tools-hero-inner {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 64px 1.5rem 56px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.tools-hero h1 {
  font-size: 2.9rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.5;
  margin-bottom: 18px;
}
.tools-hero-desc {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 2.1;
  max-width: 520px;
}
@media (max-width: 900px) {
  .tools-hero h1 { font-size: 2.1rem; }
}

/* Grid */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tool-grid { grid-template-columns: 1fr; } }

/* Card */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.tool-card[hidden] { display: none; }
.tool-card:hover { border-color: var(--border-2); background: var(--raise); text-decoration: none; }

.tool-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tool-card-kind {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--accent);
}
.tool-card-num {
  font-size: .72rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.tool-card-body { display: flex; flex-direction: column; gap: 5px; }
.tool-card-title { font-size: 1.05rem; font-weight: 600; line-height: 1.6; }
.tool-card-desc { font-size: .84rem; color: var(--muted); line-height: 1.9; }
.tool-card-meta { margin-top: auto; padding-top: 6px; font-size: .8rem; color: var(--faint); }

/* ─────────────────────────────────────────────
   TOOL DETAIL
───────────────────────────────────────────── */
.td2-page { position: relative; }
.td2-page-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 30% at 50% 0%, rgba(166,195,160,.08), transparent 75%);
  transition: opacity .3s;
}
[data-lamp="off"] .td2-page-glow { opacity: 0; }

.td2-inner {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 44px 1.5rem 92px;
}

.td2-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 56px;
  align-items: start;
}
@media (max-width: 860px) {
  .td2-layout { grid-template-columns: 1fr; }
  .td2-aside { position: static !important; }
  .td2-title { font-size: 1.9rem !important; }
}

.td2-aside {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Download card */
.td2-dl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}
.td2-meta-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: .84rem;
  margin-bottom: 20px;
}
.td2-meta-row { display: flex; justify-content: space-between; gap: 8px; }
.td2-meta-key { color: var(--faint); }
.td2-meta-val { color: var(--muted); }
.td2-files-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.td2-file-list { display: flex; flex-direction: column; }
.td2-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}
.td2-file-item:hover { background: var(--raise); text-decoration: none; }
.td2-file-ext {
  flex-shrink: 0;
  width: 44px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--accent);
  border: 1px solid rgba(166,195,160,.35);
  border-radius: 5px;
  text-align: center;
  padding: 3px 0;
}
.td2-file-info { flex: 1; min-width: 0; }
.td2-file-name { display: block; font-size: .86rem; font-weight: 500; line-height: 1.6; }
.td2-file-desc { display: block; font-size: .72rem; color: var(--faint); }
.td2-file-dl { flex-shrink: 0; font-size: .9rem; color: var(--muted); }
.td2-license { margin: 16px 0 0; font-size: .76rem; color: var(--faint); line-height: 1.9; text-align: center; }

/* Main content */
.td2-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--accent);
}
.td2-eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
  display: block;
}
.td2-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.45;
  margin-bottom: 14px;
}
.td2-desc {
  font-size: 1.02rem;
  color: var(--muted);
  line-height: 2.1;
  max-width: 560px;
  margin-bottom: 36px;
}

/* Preview area */
.td2-preview {
  aspect-ratio: 16/10;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 40px;
}
.td2-preview img { width: 100%; height: 100%; object-fit: cover; }
.td2-preview-placeholder {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(45deg, var(--surface) 0 14px, var(--raise) 14px 28px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.td2-preview-placeholder span {
  font-size: 12px;
  color: var(--faint);
  background: var(--bg);
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-family: ui-monospace, Menlo, monospace;
}

.tool-related-posts { display: flex; flex-direction: column; gap: 0.625rem; }
.tool-related-post-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: inherit;
  transition: border-color 0.15s;
}
.tool-related-post-card:hover { border-color: var(--accent); text-decoration: none; }
.tool-related-post-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--accent-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.tool-related-post-title { flex: 1; font-size: 0.95rem; font-weight: 500; }
.tool-related-post-link { color: var(--accent); font-size: 0.85rem; font-weight: 600; flex-shrink: 0; }

/* ─────────────────────────────────────────────
   ABOUT PAGE v5
───────────────────────────────────────────── */

/* top ambient glow */
.ab-top-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 26% at 50% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 75%);
  z-index: 0;
}
[data-lamp="off"] .ab-top-glow { display: none; }

/* page wrapper */
.ab-wrap {
  position: relative;
  max-width: 1060px;
  margin: 0 auto;
  padding: 64px 28px 92px;
  z-index: 1;
}

/* ── eyebrow ──────────────────────────────── */
.ab-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.ab-eyebrow-line {
  width: 24px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
  flex-shrink: 0;
}
.ab-eyebrow-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--accent);
}

/* ── hero ─────────────────────────────────── */
.ab-hero {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 56px;
  align-items: start;
  margin-bottom: 72px;
}
.ab-hero-h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.5;
  margin-bottom: 20px;
}
.ab-hero-muted {
  color: var(--muted);
  font-weight: 400;
}
.ab-hero-bio {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 2.15;
  max-width: 540px;
  margin-bottom: 16px;
}
.ab-hero-cta {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 28px;
  flex-wrap: wrap;
}
.ab-btn-contact {
  display: inline-block;
  background: var(--accent);
  color: #171210;
  font-weight: 700;
  font-size: 14px;
  padding: 11px 26px;
  border-radius: 8px;
  text-decoration: none;
  transition: transform .15s;
}
.ab-btn-contact:hover { transform: translateY(-1px); color: #171210; }
.ab-hero-link {
  font-size: .9rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding-bottom: 2px;
}
.ab-hero-link:hover { color: var(--accent); }

/* portrait */
.ab-portrait {
  aspect-ratio: 3/4;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.ab-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ab-portrait-placeholder {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(45deg, var(--surface) 0 14px, var(--raise) 14px 28px);
}

/* ── experience ───────────────────────────── */
.ab-exp { margin-bottom: 72px; }
.ab-exp-list { display: flex; flex-direction: column; }
.ab-exp-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 28px;
  padding: 22px 4px;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.ab-exp-years {
  font-size: .8rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.ab-exp-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.ab-exp-role  { font-size: 1.05rem; font-weight: 600; }
.ab-exp-company { font-size: .85rem; color: var(--accent); }
.ab-exp-desc {
  font-size: .88rem;
  color: var(--muted);
  line-height: 2;
  margin: 4px 0 0;
  max-width: 560px;
}

/* ── bootcamps ────────────────────────────── */
.ab-camps-section { }
.ab-camps-intro {
  color: var(--muted);
  font-size: .95rem;
  line-height: 2.1;
  max-width: 560px;
  margin: 0 0 24px;
}
.ab-camps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.ab-camp-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, background .15s;
}
.ab-camp-card:hover {
  border-color: var(--border-2);
  background: var(--raise);
  color: inherit;
}
.ab-camp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ab-camp-kind   { font-size: .72rem; font-weight: 600; letter-spacing: .06em; color: var(--accent); }
.ab-camp-status { font-size: .72rem; color: var(--faint); }
.ab-camp-mid    { display: flex; flex-direction: column; gap: 4px; }
.ab-camp-name   { font-size: 1.05rem; font-weight: 600; line-height: 1.6; }
.ab-camp-desc   { font-size: .84rem; color: var(--muted); line-height: 1.9; }
.ab-camp-cta    { margin-top: auto; padding-top: 8px; font-size: .8rem; color: var(--faint); }

/* ── Responsive ───────────────────────────── */
@media (max-width: 860px) {
  .ab-hero { grid-template-columns: 1fr; }
  .ab-portrait { display: none; }
  .ab-hero-h1 { font-size: 2rem; }
  .ab-camps-grid { grid-template-columns: 1fr; }
  .ab-exp-row { grid-template-columns: 90px 1fr; }
}

/* ─────────────────────────────────────────────
   CONTACT PAGE v5
───────────────────────────────────────────── */

/* top glow — reuses ab-top-glow pattern */
.ct-top-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 30% at 50% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 75%);
  z-index: 0;
}
[data-lamp="off"] .ct-top-glow { display: none; }

.ct-outer {
  position: relative;
  z-index: 1;
  max-width: 1060px;
  margin: 0 auto;
  padding: 64px 28px 92px;
}

/* 2-column grid: form + sidebar */
.ct-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 64px;
  align-items: start;
}

/* ── main form area ───────────────────────── */
.ct-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.5;
  margin-bottom: 16px;
}
.ct-desc {
  color: var(--muted);
  font-size: 1rem;
  line-height: 2.1;
  max-width: 480px;
  margin-bottom: 36px;
}

/* feedback banners */
.ct-feedback {
  font-size: .9rem;
  line-height: 1.8;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  max-width: 560px;
}
.ct-feedback--ok  { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.ct-feedback--err { background: color-mix(in srgb, #e07070 12%, transparent); color: #e09090; border: 1px solid color-mix(in srgb, #e07070 30%, transparent); }

/* form layout */
.ct-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
}
.ct-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.ct-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: .9rem;
  color: var(--text);
  outline: none;
  width: 100%;
  transition: border-color .15s;
}
.ct-input:focus { border-color: var(--border-2); }
.ct-input::placeholder { color: var(--faint); }
.ct-input-ltr { direction: ltr; text-align: right; }
.ct-textarea { resize: vertical; line-height: 2; font-size: .94rem; }
.ct-submit-row { display: flex; align-items: center; gap: 16px; }
.ct-submit-btn {
  background: var(--accent);
  color: #171210;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 30px;
  cursor: pointer;
  transition: opacity .15s;
}
.ct-submit-btn:hover { opacity: .9; }

/* ── sidebar ──────────────────────────────── */
.ct-aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.ct-channels-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}
.ct-channels-title {
  display: block;
  font-size: .92rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.ct-channels-list { display: flex; flex-direction: column; }
.ct-channel-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: color .15s;
}
.ct-channel-row--last { border-bottom: none; }
.ct-channel-row:hover { color: var(--accent); }
.ct-channel-label { font-size: .85rem; color: var(--faint); }
.ct-channel-value { font-size: .88rem; }

.ct-note-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
}
.ct-note-text {
  font-size: .85rem;
  color: var(--muted);
  line-height: 2;
  margin: 0;
}

/* admin table unread row highlight */
.ct-row-unread td { font-weight: 500; }

/* ── admin badge helpers ───────────────────── */
.badge { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .04em; padding: 2px 8px; border-radius: 4px; }
.badge-accent { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.badge-muted  { background: var(--raise); color: var(--faint); }

/* ── Telegram strip (tg) ──────────────────────── */
.tg-strip {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 44px 40px;
  margin: 48px auto;
  max-width: 1100px;
  width: calc(100% - 48px);
}
.tg-glow {
  position: absolute;
  top: -60px;
  left: -60px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(41,182,246,.07) 0%, transparent 70%);
  pointer-events: none;
}
.tg-inner {
  display: flex;
  align-items: center;
  gap: 48px;
}
.tg-copy {
  flex: 1 1 0;
  min-width: 0;
}
.tg-copy h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 10px;
}
.tg-copy p {
  color: var(--muted);
  font-size: .9rem;
  line-height: 2;
  margin: 0;
}
.tg-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.tg-btn {
  display: inline-block;
  background: var(--accent);
  color: #171210;
  font-weight: 700;
  border-radius: 8px;
  padding: 13px 32px;
  font-size: .95rem;
  font-family: inherit;
  text-decoration: none;
  transition: opacity .15s;
  white-space: nowrap;
}
.tg-btn:hover { opacity: .85; }
.tg-handle {
  font-size: .8rem;
  color: var(--muted);
  letter-spacing: .02em;
}

/* ── Contact page Telegram card (ct-tg) ──────── */
.ct-tg-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.ct-tg-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.ct-tg-text {
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.9;
  margin: 0;
}
.ct-tg-btn {
  display: inline-block;
  background: var(--accent);
  color: #171210;
  font-weight: 700;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: .88rem;
  font-family: inherit;
  text-decoration: none;
  transition: opacity .15s;
  text-align: center;
}
.ct-tg-btn:hover { opacity: .85; }
.ct-tg-handle {
  font-size: .78rem;
  color: var(--faint);
  text-align: center;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 860px) {
  .ct-layout { grid-template-columns: 1fr; }
  .ct-title   { font-size: 1.9rem; }
}
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .site-header .container { gap: 12px; }

  .site-nav {
    position: fixed;
    inset-inline: 0;
    top: var(--header-h);
    z-index: 30;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 1.5rem 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }
  .site-header.is-nav-open .site-nav { display: flex; }

  .site-nav a {
    padding: 12px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
  }
  .site-nav a:last-of-type { border-bottom: none; }

  .site-nav .login-btn {
    display: inline-flex;
    justify-content: center;
    margin-top: 12px;
    padding: 10px 16px;
    border: 1px solid var(--border-2);
    border-radius: 8px;
  }

  .site-nav .user-chip { margin-top: 12px; }
  .site-nav .user-chip__btn { width: 100%; justify-content: center; }
  .site-nav .user-menu {
    position: static;
    margin-top: 8px;
    box-shadow: none;
    border: 1px solid var(--border);
  }
  .site-nav .user-menu[hidden] { display: none; }
}

@media (max-width: 640px) {
  .site-footer .container { flex-direction: column; align-items: flex-start; }
  .ct-row-2 { grid-template-columns: 1fr; }
  .tg-strip { padding: 32px 20px; width: calc(100% - 32px); }
  .tg-inner { flex-direction: column; gap: 28px; }
  .tg-action { width: 100%; }
  .tg-btn { width: 100%; text-align: center; }
  .container { padding: 0 1rem; }
}
@media (max-width: 480px) {
  :root { --header-h: 60px; }
  .site-nav a { font-size: 13px; }
  .hero-title { font-size: 2.2rem; }
  .btn { padding: 11px 18px; font-size: 14px; }
}

/* ══════════════════════════════════════════════════════════
   Telegram Popup — v13.5
   ══════════════════════════════════════════════════════════ */
.tg-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: tg-popup-in 200ms ease forwards;
}
.tg-popup--hidden {
  display: none !important;
}
.tg-popup--out {
  animation: tg-popup-out 150ms ease forwards;
}
@keyframes tg-popup-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes tg-popup-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* Overlay */
.tg-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(2px);
}

/* Box */
.tg-popup__box {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 36px 32px;
  max-width: 400px;
  width: calc(100% - 40px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
}

/* Close button */
.tg-popup__close {
  position: absolute;
  top: 14px;
  left: 16px;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.tg-popup__close:hover {
  color: var(--text);
  background: var(--surface-2);
}

/* Icon */
.tg-popup__icon {
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 4px;
}

/* Title */
.tg-popup__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

/* Body */
.tg-popup__body {
  font-size: .92rem;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

/* Join CTA */
.tg-popup__join {
  display: inline-block;
  margin-top: 8px;
  background: #229ED9;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: .92rem;
  padding: 12px 24px;
  border-radius: 10px;
  width: 100%;
  box-sizing: border-box;
  transition: background .15s, transform .1s;
}
.tg-popup__join:hover {
  background: #1a8cc0;
  transform: translateY(-1px);
}

/* Later link */
.tg-popup__later {
  font-size: .82rem;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
  transition: color .15s;
}
.tg-popup__later:hover {
  color: var(--text);
}

/* Responsive */
@media (max-width: 480px) {
  .tg-popup__box {
    padding: 36px 24px 28px;
    border-radius: 16px;
  }
}

/* ─────────────────────────────────────────────
   AUTH NAV — user chip + dropdown (v12)
───────────────────────────────────────────── */
.login-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent) !important;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 7px;
  padding: 6px 16px;
  text-decoration: none !important;
  transition: background .15s;
}
.login-btn:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  text-decoration: none !important;
}

.user-chip { position: relative; }

.user-chip__btn {
  display: flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: 1px solid var(--border-2);
  border-radius: 20px;
  padding: 5px 12px 5px 6px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  max-width: 190px;
  transition: border-color .15s;
}
.user-chip__btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.user-chip__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.user-chip__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 22%, #241d16);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-chip__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip__arrow {
  font-size: 9px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform .15s;
}
.user-chip__btn[aria-expanded="true"] .user-chip__arrow { transform: rotate(180deg); }

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  background: var(--raise);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 6px;
  z-index: 100;
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
}

.user-menu__item {
  display: block;
  width: 100%;
  font-family: var(--font);
  font-size: .85rem;
  color: var(--text);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 7px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: right;
  transition: background .12s, color .12s;
}
.user-menu__item:hover {
  background: var(--surface);
  color: var(--accent);
  text-decoration: none;
}
.user-menu__item--logout:hover { color: #d98878; }
.user-menu__divider {
  height: 1px;
  background: var(--border);
  margin: 5px 8px;
}

/* ─────────────────────────────────────────────
   LOGIN PAGE (v12)
───────────────────────────────────────────── */
.auth-page {
  position: relative;
  overflow: hidden;
}

.auth-page__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 45% at 50% 22%,
    color-mix(in srgb, var(--accent) 11%, transparent), transparent 70%);
  pointer-events: none;
}

.auth-page__inner {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  padding: 86px 28px 96px;
  text-align: center;
}

/* Small decorative lamp mark */
.auth-lamp {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 36px;
}
.auth-lamp__shade {
  width: 66px;
  height: 32px;
  display: block;
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, #4a3a28, var(--accent));
  transition: background .25s;
}
[data-lamp="off"] .auth-lamp__shade { background: linear-gradient(180deg, #33291d, #453626); }
.auth-lamp__pole { width: 4px; height: 52px; background: #3d3125; display: block; }
.auth-lamp__foot { width: 44px; height: 9px; background: #3d3125; border-radius: 5px 5px 0 0; display: block; }

.auth-lamp--sm .auth-lamp__shade { width: 46px; height: 22px; }
.auth-lamp--sm .auth-lamp__pole  { height: 34px; }
.auth-lamp--sm .auth-lamp__foot  { width: 30px; height: 6px; border-radius: 4px 4px 0 0; }

.auth-page__title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.5;
}

.auth-page__sub {
  margin-top: 16px;
  font-size: .98rem;
  color: var(--muted);
  line-height: 2.1;
  margin-bottom: 0;
}

.auth-page__error {
  margin-top: 26px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: right;
  background: color-mix(in srgb, #d98878 10%, transparent);
  border: 1px solid color-mix(in srgb, #d98878 34%, transparent);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: .88rem;
  line-height: 1.9;
}
.auth-page__error [aria-hidden] { color: #d98878; font-size: .95rem; line-height: 1.9; }

.auth-page__form { margin-top: 32px; }

.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 330px;
  background: #fff;
  color: #1f1a17;
  font-family: var(--font);
  font-weight: 700;
  font-size: 15px;
  border: none;
  border-radius: 9px;
  padding: 14px 26px;
  cursor: pointer;
  transition: transform .15s, background .15s;
  box-shadow: 0 8px 26px rgba(0,0,0,.35);
}
.google-btn:hover { background: #f6f2ec; transform: translateY(-1px); }
.google-btn:active { transform: translateY(0); }
.google-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.google-btn__icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #4285f4;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}

.auth-page__fine {
  margin-top: 20px;
  font-size: .8rem;
  color: var(--faint);
  line-height: 2;
  margin-bottom: 0;
}

.auth-page__perks {
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
}
.auth-page__perks-label { font-size: .78rem; color: var(--faint); }
.auth-page__perks span:not(.auth-page__perks-label) { font-size: .85rem; color: var(--muted); line-height: 2; }

/* ─────────────────────────────────────────────
   PROFILE / DASHBOARD PAGE (v12)
───────────────────────────────────────────── */
.profile-page { }

.profile-hero {
  position: relative;
  overflow: hidden;
}
.profile-hero__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 48% 62% at 76% 62%,
    color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
  pointer-events: none;
}
.profile-hero__inner {
  position: relative;
  padding-top: 52px;
  padding-bottom: 0;
}

.profile-desk-layout {
  margin-top: 26px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
  flex-wrap: wrap;
  padding-bottom: 64px;
}

.profile-info { flex: 1; min-width: 0; }

.profile-info__greeting {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.45;
}

.profile-info__meta {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: .88rem;
  color: var(--muted);
}
.profile-info__email { color: var(--text); font-size: .85rem; }

.profile-info__actions {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Desk illustration ───────────── */
.profile-desk {
  flex-shrink: 0;
  width: 330px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-desk__scene {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding-inline-end: 14px;
}

/* Profile lamp (larger than auth-lamp, interactive) */
.profile-lamp {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 186px;
  position: relative;
  font-family: var(--font);
}
.profile-lamp:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.profile-lamp__cone {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 186px;
  height: 104px;
  display: block;
  pointer-events: none;
  clip-path: polygon(34% 0, 66% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 28%, transparent), transparent);
  opacity: 1;
  transition: opacity .3s;
}
[data-lamp="off"] .profile-lamp__cone { opacity: 0; }
.profile-lamp__shade {
  width: 66px;
  height: 32px;
  display: block;
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, #4a3a28, var(--accent));
  transition: background .25s;
}
[data-lamp="off"] .profile-lamp__shade { background: linear-gradient(180deg, #33291d, #453626); }
.profile-lamp__pole { width: 4px; height: 88px; background: #3d3125; display: block; }
.profile-lamp__foot { width: 44px; height: 9px; background: #3d3125; border-radius: 5px 5px 0 0; display: block; }

.profile-desk__books {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.profile-desk__book {
  display: block;
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(236,229,220,.07);
}

.profile-desk__mug { display: flex; align-items: flex-end; gap: 2px; }
.profile-desk__mug-body {
  width: 26px; height: 30px;
  background: #2e2318;
  border-radius: 3px 3px 6px 6px;
  display: block;
  box-shadow: inset 0 3px 0 color-mix(in srgb, var(--accent) 30%, transparent);
}
.profile-desk__mug-handle {
  width: 9px; height: 14px;
  border: 2.5px solid #2e2318;
  border-inline-start: none;
  border-radius: 0 8px 8px 0;
  display: block;
  margin-bottom: 8px;
}

.profile-desk__surface {
  width: 100%;
  height: 14px;
  background: linear-gradient(180deg, #3a2d20, #241b12);
  border-radius: 2px;
  box-shadow: 0 12px 30px rgba(0,0,0,.55);
}
.profile-desk__edge {
  width: 88%;
  height: 7px;
  background: #1c1510;
  border-radius: 0 0 4px 4px;
}
.profile-desk__hint {
  margin-top: 8px;
  font-size: .78rem;
  color: var(--faint);
  line-height: 2;
  text-align: center;
}

/* ── Accent color swatches ───────── */
.profile-swatches {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.profile-swatches__label { font-size: .76rem; color: var(--faint); }
.profile-swatches__row { display: flex; align-items: center; gap: 8px; }

.profile-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  border: 2px solid transparent;
  box-shadow: 0 0 0 1px rgba(236,229,220,.18);
  transition: transform .15s, border-color .15s;
}
.profile-swatch:hover { transform: scale(1.1); }
.profile-swatch:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* ── Newsletter / Telegram card ──── */
.profile-section { padding: 60px 0; }

.section-header { margin-bottom: 24px; }
.section-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.section-kicker::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}

/* ── Placeholder (coming soon) ──── */
.profile-placeholder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 64px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.profile-placeholder b { font-size: 1.05rem; font-weight: 600; }
.profile-placeholder p { font-size: .9rem; color: var(--muted); line-height: 2; margin: 0; }

/* ── Shared buttons (used in profile) ── */
.btn {
  display: inline-block;
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  padding: 11px 24px;
  border-radius: 8px;
  text-decoration: none !important;
  transition: transform .15s, opacity .15s;
  cursor: pointer;
  border: none;
}
.btn:hover { transform: translateY(-1px); text-decoration: none !important; }
.btn--primary { background: var(--accent); color: #171210 !important; }
.btn--primary:hover { color: #171210 !important; }
.btn--outline {
  background: none;
  color: var(--text) !important;
  border: 1px solid var(--border-2);
}
.btn--outline:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent) !important;
}

/* ─────────────────────────────────────────────
   ADMIN: users table helpers (v12)
───────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .73rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.status-badge--ok {
  background: color-mix(in srgb, #8fbf86 12%, transparent);
  border: 1px solid color-mix(in srgb, #8fbf86 32%, transparent);
  color: #8fbf86;
}
.status-badge--bad {
  background: color-mix(in srgb, #d98878 12%, transparent);
  border: 1px solid color-mix(in srgb, #d98878 32%, transparent);
  color: #d98878;
}
.btn-table {
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--border-2);
}
.btn-table--muted { background: none; color: var(--muted); }
.btn-table--ok {
  background: color-mix(in srgb, #8fbf86 12%, transparent);
  border-color: color-mix(in srgb, #8fbf86 36%, transparent);
  color: #8fbf86;
}
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 0;
}
.admin-pagination__btn {
  font-size: .8rem;
  font-weight: 600;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 6px 13px;
  color: var(--text);
  text-decoration: none;
}
.admin-pagination__btn--disabled {
  color: var(--faint);
  border-color: var(--border);
  cursor: default;
}
.admin-pagination__info { font-size: .85rem; color: var(--muted); }
.admin-meta-line { font-size: .78rem; color: var(--muted); margin-bottom: 16px; }

.btn--sm { font-size: .82rem; padding: 6px 14px; border-radius: 8px; }

/* ── My Comments (v14) ────────────────────────────────────────────────── */
.section-count {
  font-size: .8rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 2px 10px;
  margin-right: 8px;
}
.profile-comments {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
}
.pcomment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.pcomment__header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
.pcomment__badge {
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}
.pcomment__badge--post { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.pcomment__badge--book { background: color-mix(in srgb, #b9a98a 25%, transparent); color: #8a6e44; }
.pcomment__title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  flex: 1;
}
.pcomment__title:hover { color: var(--accent); }
.pcomment__date { font-size: .78rem; color: var(--faint); }
.pcomment__body { }
.pcomment__text {
  font-size: .9rem;
  line-height: 2;
  margin: 0 0 4px;
  white-space: pre-line;
}
.pcomment__expand {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent);
  font-size: .8rem;
  padding: 0;
  font-family: inherit;
}
.pcomment__reply {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-right: 3px solid var(--accent);
  border-radius: 6px;
  padding: .75rem 1rem;
  margin-top: .25rem;
}
.pcomment__reply-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .4rem;
}
.pcomment__reply-label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent);
}
.pcomment__reply-date { font-size: .75rem; color: var(--faint); }
.pcomment__reply-text {
  font-size: .88rem;
  line-height: 2;
  margin: 0;
  white-space: pre-line;
}
.status-badge--pending {
  background: color-mix(in srgb, #c9a030 18%, transparent);
  color: #8a6d14;
  border: 1px solid color-mix(in srgb, #c9a030 30%, transparent);
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ── Bookshelf widget — aside on book detail page (v15) ───────────────── */
.bd2-bookshelf {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
/* Status badge (shown when book already in shelf) */
.bd2-bs-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .74rem;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 20px;
  white-space: nowrap;
  align-self: flex-start;
}
.bd2-bs-badge--want  { background: color-mix(in srgb, var(--muted) 12%, transparent); border: 1px solid color-mix(in srgb, var(--muted) 32%, transparent); color: var(--muted); }
.bd2-bs-badge--reading { background: color-mix(in srgb, #d9a05f 12%, transparent); border: 1px solid color-mix(in srgb, #d9a05f 32%, transparent); color: #d9a05f; }
.bd2-bs-badge--read  { background: color-mix(in srgb, #8fbf86 12%, transparent); border: 1px solid color-mix(in srgb, #8fbf86 32%, transparent); color: #8fbf86;  }
/* Pill row */
.bd2-bs-pills {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.bd2-bs-pill {
  font-family: inherit;
  font-size: .78rem;
  font-weight: 600;
  padding: 7px 15px;
  border-radius: 20px;
  cursor: pointer;
  transition: all .16s;
  white-space: nowrap;
  text-align: center;
  background: var(--raise);
  border: 1px solid var(--border);
  color: var(--muted);
}
.bd2-bs-pill:hover:not(.bd2-bs-pill--on) {
  border-color: var(--accent);
  color: var(--accent);
}
/* Active states per status (matching design) */
.bd2-bs-pill--want.bd2-bs-pill--on,
.bd2-bs-pill--reading.bd2-bs-pill--on {
  background: var(--accent);
  border-color: var(--accent);
  color: #171210;
}
.bd2-bs-pill--read.bd2-bs-pill--on {
  background: color-mix(in srgb, #8fbf86 14%, transparent);
  border: 1px solid color-mix(in srgb, #8fbf86 40%, transparent);
  color: #8fbf86;
}
/* Remove link */
.bd2-bs-remove-form { margin: 0; }
.bd2-bs-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: .75rem;
  color: var(--faint);
  padding: 0;
  text-align: center;
  width: 100%;
}
.bd2-bs-remove:hover { color: #d98878; }
/* Login nudge */
.bd2-bs-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 8px 0;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 20px;
  transition: background .15s;
}
.bd2-bs-cta:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent); }
/* Social proof count */
.bd2-bs-count {
  font-size: .74rem;
  color: var(--faint);
  text-align: center;
  margin: 0;
}
/* Bookshelf page pill (smaller, horizontal row) */
.bd2-bs-pill--sm { font-size: .77rem; padding: 4px 11px; }
.bsp-card__pills .bd2-bs-pill { width: auto; }

/* ── Review modal (v15) ────────────────────────────────────────────────── */
.review-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.review-modal-overlay[hidden] { display: none; }
.review-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
  max-width: 480px;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.review-modal__close {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1;
  padding: 4px;
}
.review-modal__close:hover { color: var(--text); }
.review-modal__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  padding-left: 2rem; /* space for × button */
}
.review-modal__book {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.review-modal__cover {
  width: 44px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.review-modal__book-title {
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.5;
}
.review-modal__section { display: flex; flex-direction: column; gap: .5rem; }
.review-modal__label { font-size: .82rem; color: var(--muted); font-weight: 600; }
.review-modal__stars { gap: 4px; }
#review-comment-form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  width: 100%;
}
.review-modal__textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font);
  font-size: .88rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  resize: vertical;
  min-height: 80px;
  line-height: 1.9;
  transition: border-color .15s;
}
.review-modal__textarea:focus { outline: none; border-color: var(--border-2); }
.review-modal__textarea::placeholder { color: var(--faint); }
.review-modal__submit { align-self: flex-start; }
.review-modal__submit:disabled { opacity: .45; cursor: not-allowed; }
.review-modal__skip {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .82rem;
  color: var(--faint);
  font-family: inherit;
  align-self: center;
  text-decoration: underline;
}
.review-modal__skip:hover { color: var(--text); }

/* ── Bookshelf page (v15) ─────────────────────────────────────────────── */
.bookshelf-page { padding-top: 2rem; padding-bottom: 4rem; }
.bookshelf-page__header {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.bookshelf-page__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}
.bsp-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .88rem;
  color: var(--muted);
}
.bsp-summary__num { font-weight: 700; color: var(--text); }
.bsp-summary__item--read .bsp-summary__num { color: var(--accent); }
.bsp-summary__sep { color: var(--faint); }
.bsp-list { display: flex; flex-direction: column; gap: .875rem; }
.bsp-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
}
.bsp-card--read { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.bsp-card__cover-link { flex-shrink: 0; }
.bsp-card__cover {
  width: 52px;
  height: 70px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bsp-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.bsp-card__cover-icon { font-size: 1.5rem; }
.bsp-card__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.bsp-card__title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
}
.bsp-card__title:hover { color: var(--accent); }
.bsp-card__check { color: var(--accent); }
.bsp-card__author { font-size: .82rem; color: var(--muted); }
.bsp-card__date { font-size: .77rem; color: var(--faint); }
.bsp-card__pills {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .25rem;
}
.bsp-card__remove-form { flex-shrink: 0; }
.bsp-card__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--faint);
  font-size: .9rem;
  padding: 4px;
  line-height: 1;
}
.bsp-card__remove:hover { color: var(--text); }

@media (max-width: 860px) {
  .profile-desk-layout { flex-direction: column; align-items: flex-start; gap: 28px; }
  .profile-desk { width: 100%; }
    .bsp-card { flex-wrap: wrap; }
}
/* ─────────────────────────────────────────────
   ROADMAP landing — hero lamp (v16)
───────────────────────────────────────────── */
[data-lamp="off"] .rm-hero-glow { opacity: 0; }

.rm-lamp-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-inline-end: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 250px;
  position: relative;
  font-family: inherit;
}
.rm-lamp-cone {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 230px;
  height: 130px;
  display: block;
  pointer-events: none;
  clip-path: polygon(36% 0, 64% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 28%, transparent), transparent);
  transition: opacity .3s;
}
[data-lamp="off"] .rm-lamp-cone { opacity: 0; }
.rm-lamp-shade {
  width: 66px;
  height: 32px;
  display: block;
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, #4a3a28, var(--accent));
  transition: background .25s;
}
[data-lamp="off"] .rm-lamp-shade { background: linear-gradient(180deg, #33291d, #453626); }
.rm-lamp-pole { width: 4px; height: 140px; background: #3d3125; display: block; }
.rm-lamp-base { width: 44px; height: 9px; background: #3d3125; border-radius: 5px 5px 0 0; display: block; }

@media (max-width: 960px) {
  .rm-hero-visual {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    padding-bottom: 4px;
  }
  .rm-lamp-btn {
    height: 180px;
    margin-inline-end: 14px;
  }
  .rm-lamp-pole { height: 90px; }
  .rm-lamp-cone { width: 150px; height: 85px; }
  .rm-stairs { padding-top: 24px; flex-shrink: 0; }
  .rm-step { width: 58px; }
}

/* ── v17 learning enrollment ─────────────────────────────── */
:root { --sprout: #8fbf86; }

.ra-res {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start;
  padding: 14px 2px; border-bottom: 1px solid var(--border);
}
.ra-res-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ra-res-title { font-size: .96rem; font-weight: 600; display: inline-block; }
.ra-res-link {
  font-size: .96rem; font-weight: 600; color: inherit;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  display: inline-block;
}
.ra-res-link:hover { color: var(--accent); text-decoration: none; }
.ra-res-sub { font-size: .76rem; color: var(--faint); margin-top: 3px; }
.ra-no-link { font-size: .68rem; color: var(--faint); border: 1px dashed var(--border-2); border-radius: 5px; padding: 2px 8px; white-space: nowrap; }
.ra-tag-req { font-size: .72rem; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); border-radius: 6px; padding: 3px 9px; white-space: nowrap; }
.ra-tag-opt { font-size: .72rem; font-weight: 600; color: var(--faint); border: 1px solid var(--border); border-radius: 6px; padding: 3px 9px; white-space: nowrap; }
.ra-tag-meta { font-size: .74rem; color: var(--muted); background: rgba(236,229,220,.05); border-radius: 6px; padding: 3px 9px; white-space: nowrap; }

.learn-cta {
  display: block; width: 100%; text-align: center;
  font-family: inherit; font-size: .95rem; font-weight: 700;
  background: var(--accent); color: #171210 !important;
  border: none; border-radius: 10px; padding: 12px 18px;
  cursor: pointer; text-decoration: none;
}
.learn-cta:hover { text-decoration: none; opacity: .92; }
.learn-cta--ghost {
  background: transparent; color: var(--accent) !important;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.learn-cta-note { font-size: .74rem; color: var(--faint); margin-top: 10px; line-height: 1.8; }
.learn-social { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.learn-social span { font-size: .8rem; color: var(--muted); }

.learn-enroll-band {
  margin-top: 48px;
  padding-bottom: 8px;
}
.learn-enroll-card {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 280px);
  gap: 32px;
  align-items: center;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  border-radius: 16px;
  padding: 28px 32px;
}
.learn-enroll-kicker {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--accent);
  margin-bottom: 10px;
}
.learn-enroll-title {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.7;
}
.learn-enroll-body {
  font-size: .88rem;
  color: var(--muted);
  line-height: 2;
  margin-top: 8px;
  max-width: 560px;
}
.learn-social--stats {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.learn-social-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: .8rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 999px;
  padding: 6px 12px;
}
.learn-social-stat b {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent);
}
.learn-enroll-nudge {
  font-size: .8rem;
  color: var(--text);
  margin-top: 12px;
  line-height: 1.9;
}
.learn-cta--banner {
  width: auto;
  min-width: 240px;
  padding: 14px 22px;
  font-size: 1rem;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 28%, transparent);
}
.learn-enroll-actions .learn-cta-note { text-align: center; }
@media (max-width: 760px) {
  .learn-enroll-card {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 22px 20px;
  }
  .learn-cta--banner { width: 100%; min-width: 0; }
}

.learn-progress {
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
}
.learn-progress-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.learn-progress-pct { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.learn-progress-pct span { font-size: 1rem; font-weight: 600; color: var(--muted); }
.learn-progress-note { font-size: .78rem; color: var(--faint); max-width: 420px; line-height: 1.9; }
.learn-bar {
  margin-top: 14px; height: 8px; border-radius: 99px;
  background: rgba(236,229,220,.08); overflow: hidden;
}
.learn-bar > i {
  display: block; height: 100%; width: var(--p, 0%);
  background: var(--accent); border-radius: 99px;
}
.learn-progress-facts {
  margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 18px;
  font-size: .8rem; color: var(--muted);
}
.learn-progress-facts b { color: var(--text); }

.learn-now {
  margin-top: 16px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.learn-now-k { font-size: .7rem; font-weight: 700; letter-spacing: .06em; color: var(--accent); margin-bottom: 6px; }
.learn-now h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.learn-now h2 .ra-res-link { font-size: inherit; font-weight: inherit; }
.learn-now p { font-size: .8rem; color: var(--faint); margin: 4px 0 0; }
.learn-hint { font-size: .8rem; color: var(--faint); margin-top: 10px; }

.learn-status {
  font-family: inherit; font-size: .74rem;
  background: var(--raise); color: var(--text);
  border: 1px solid var(--border-2); border-radius: 6px;
  padding: 4px 8px; min-width: 132px;
}
.learn-status:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
.ra-res[data-status="DONE"] .learn-status,
.ra-res[data-status="ALREADY_KNEW"] .learn-status { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.ra-res[data-status="STUDYING"] .learn-status { border-color: color-mix(in srgb, #d9a05f 50%, transparent); }
.ra-res.is-optional { opacity: .78; }
.learn-status-form { margin: 0; }

.learn-badge {
  font-size: .72rem; font-weight: 700; border-radius: 6px; padding: 3px 10px; white-space: nowrap;
}
.learn-badge--enrolled { color: var(--muted); background: rgba(236,229,220,.07); }
.learn-badge--progress { color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); }
.learn-badge--done { color: var(--sprout); background: color-mix(in srgb, var(--sprout) 14%, transparent); }

.learn-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.learn-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 24px;
}
.learn-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); text-decoration: none; }
.learn-card-k { font-size: .72rem; color: var(--faint); }
.learn-card h3 { font-size: 1.15rem; font-weight: 800; margin: 4px 0 6px; }
.learn-card-date { font-size: .8rem; color: var(--muted); }
.learn-card-foot {
  margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.learn-card-cta { font-size: .88rem; font-weight: 600; color: var(--accent); }
.learn-card--add {
  border-style: dashed; background: transparent; opacity: .85;
  display: flex; flex-direction: column; justify-content: center; min-height: 180px;
}
.learn-card--add h3 { color: var(--muted); font-weight: 700; }
.learn-empty {
  background: var(--surface); border: 1px dashed var(--border-2); border-radius: 14px;
  padding: 36px 28px; max-width: 560px;
}
.learn-empty h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 8px; }
.learn-empty p { color: var(--muted); line-height: 2; margin-bottom: 18px; }
.unenroll {
  background: none; border: none; font-family: inherit; font-size: .82rem;
  color: var(--faint); cursor: pointer; padding: 0;
}
.unenroll:hover { color: var(--muted); }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.learn-rate-cta {
  font-size: .74rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.learn-rate-cta:hover { text-decoration: underline; }
.learn-rate-form { margin: 0; }
.learn-rate-stars { gap: 1px; }
.learn-rate-stars .bd2-star-btn { font-size: 1.05rem; }
.learn-rate-help { font-size: .82rem; color: var(--muted); margin: 0; line-height: 1.8; }
.learn-rate-error {
  margin-top: 14px;
  font-size: .88rem;
  color: #d98878;
  background: color-mix(in srgb, #d98878 12%, transparent);
  border: 1px solid color-mix(in srgb, #d98878 35%, transparent);
  border-radius: 10px;
  padding: 10px 14px;
}
.review-modal__close {
  text-decoration: none;
}

@media (max-width: 760px) {
  .learn-grid { grid-template-columns: 1fr; }
  .ra-res { grid-template-columns: 1fr; }
  .ra-res-meta { justify-content: flex-start; }
}
