/* ================= GLOBAL ================= */
.single-post .jcb-single-post {
  max-width: 100%;
  padding: 0 20px;
}

/* ================= HEADER ================= */
.single-post .jcb-post-header {
  max-width: 820px;
  margin: 56px auto 28px;
}

.single-post .jcb-post-title {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.2;
  font-weight: 700;
}

.single-post .jcb-post-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #64748b;
}

/* ================= CONTENT ================= */
.single-post .jcb-post-content {
  max-width: 820px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.85;
  color: #1e293b;
}

.single-post h2 {
  font-size: 26px;
  margin: 56px 0 18px;
}

.single-post h3 {
  font-size: 22px;
  margin: 42px 0 14px;
}

/* ================= CODE ================= */
.single-post pre {
  background: #0b1220;
  color: #e5e7eb;
  padding: 20px;
  border-radius: 14px;
  overflow-x: auto;
}

/* ================= PROGRESS ================= */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0;
  background: linear-gradient(90deg,#2160f3,#00aeef);
  z-index: 9999;
}

/* =====================================================
   TOC – DESKTOP (STICKY RIGHT)
===================================================== */
@media (min-width: 1024px) {
  .jcb-toc {
    position: fixed;
    top: 120px;
    right: 24px;
    width: 300px;
    height: calc(100vh - 160px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,.12);
    display: flex;
    flex-direction: column;
  }

  .jcb-toc-fab,
  #jcb-toc-close {
    display: none;
  }
}

/* =====================================================
   TOC – MOBILE (BOTTOM SHEET)
===================================================== */
@media (max-width: 1023px) {
  .jcb-toc {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -100%;
    height: 70vh;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -20px 40px rgba(0,0,0,.25);
    display: flex;
    flex-direction: column;
    transition: bottom .3s ease;
    z-index: 9997;
  }

  .jcb-toc.open {
    bottom: 0;
  }

  .jcb-toc-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 10px 16px;
    border-radius: 999px;
    background: #2160f3;
    color: #fff;
    border: none;
    font-size: 14px;
    z-index: 9997;
  }
}

/* ================= TOC INTERNAL ================= */
.jcb-toc-header {
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.jcb-toc-body {
  padding: 16px;
  overflow-y: auto;
}

.jcb-toc-body a {
  display: block;
  margin-bottom: 14px;
  font-size: 15px;
  color: #0f172a;
  text-decoration: none;
  word-break: break-word;
}

.jcb-toc-body a:hover,
.jcb-toc-body a:focus {
  color: #2160f3;            /* brand blue */
}

/* =====================================================
   CHATBOT – BOTTOM LEFT (SAFE)
===================================================== */
#jcb-chatbot {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9998;
}

#jcb-chat-toggle {
  padding: 10px 16px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  border: none;
  cursor: pointer;


}

.jcb-chat-window {
  display: none;
  width: 320px;
  height: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,.2);
  margin-top: 10px;
  z-index: 9998;
}

.jcb-chat-window.open {
  display: flex;
  flex-direction: column;
    z-index: 9998;

}

.jcb-chat-header {
  padding: 12px;
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
}

.jcb-chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.jcb-chat-window {
  display: none;
    z-index: 9998;

}

.jcb-chat-window.open {
  display: flex !important;
    z-index: 9998;

}

