/* ============================================================
   Booklet Page (Dargan Forum 2026) — EPW-PRO-301
   ============================================================ */

body.booklet-active #expanded-title,
body.booklet-active #detail-panel,
body.booklet-active #bg-layer,
body.booklet-active #eoins-stuff,
body.booklet-active #epw-new-item-fab,
body.booklet-active #c4-link { display: none !important; }

/* Hide speech-to-text mic buttons */
#booklet-view .epw-stt-mic { display: none !important; }

/* ---- Section headings ---- */

.bkt-section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 6px;
  padding-left: 10px;
  border-left: 3px solid #ea580c;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}
.bkt-section-heading:first-child {
  margin-top: 4px;
}
.bkt-section-label {
  flex: 1;
}
.bkt-section-pages {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
}

/* ---- Page card row ---- */

.bkt-page-card {
  border: 1px solid #e8e8f0;
  border-radius: 8px;
  background: #fff;
  margin-bottom: 6px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.bkt-page-card:hover {
  border-color: #c084fc;
  box-shadow: 0 2px 8px rgba(124,58,237,0.07);
}

/* ---- Page header (the clickable row) ---- */

.bkt-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 10px;
  cursor: pointer;
}

/* ---- A4 portrait thumbnail placeholder ---- */

.bkt-thumb {
  width: 44px;
  height: 58px;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.bkt-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}
.bkt-thumb-num {
  font-size: 15px;
  font-weight: 800;
  color: rgba(255,255,255,0.9);
  letter-spacing: -0.5px;
}

/* ---- Page title + sub-badges ---- */

.bkt-page-info {
  flex: 1;
  min-width: 0;
}
.bkt-page-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bkt-page-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.bkt-type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  padding: 1px 6px;
}
.bkt-pattern-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #7c3aed;
  background: #f3e8ff;
  border: 1px solid #ddd6fe;
  border-radius: 3px;
  padding: 1px 6px;
}

/* ---- Action badge (Update / Rewrite / Keep etc.) ---- */

.bkt-page-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.bkt-action-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-radius: 10px;
  padding: 2px 9px;
  white-space: nowrap;
}

/* ---- Expanded body ---- */

.bkt-page-body {
  display: none;
  padding: 4px 14px 12px 14px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
}
.bkt-page-card.spk-expanded .bkt-page-body {
  display: block;
}
.bkt-page-card.spk-expanded .spk-expand-arrow {
  transform: rotate(180deg);
}

/* ---- Action buttons inside expanded card ----
   Reuses .cnv-design-actions and .cnv-action-btn from canva.css ---- */

.bkt-page-actions {
  padding: 8px 0 2px;
}

/* ---- Component Mapping modal — horizontal two-column layout ---- */

#bkt-map-modal .cnv-map-content {
  width: min(1100px, 96vw);
}

#bkt-map-modal .cnv-map-body {
  flex-direction: row;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

#bkt-map-modal .cnv-map-thumb-wrap {
  width: 340px;
  min-width: 280px;
  flex-shrink: 0;
  border-bottom: none;
  border-right: 1px solid #f0f0f4;
  overflow-y: auto;
  max-height: none;
}

#bkt-map-modal .cnv-map-thumb-wrap img {
  width: 100%;
  max-height: none;
  display: block;
}

#bkt-map-modal .cnv-map-table-wrap {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
}

/* ---- View lightbox ---- */

.bkt-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bkt-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: zoom-out;
}

.bkt-lightbox-content {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 600px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bkt-lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  object-fit: contain;
}

/* ---- Component Mapping empty state ---- */

.bkt-map-empty-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 2px 10px;
  margin-left: 8px;
}

.bkt-map-no-elements {
  padding: 24px 20px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.bkt-map-no-elements code {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  font-family: monospace;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 3px 8px;
  color: #0f172a;
  word-break: break-all;
}
