/* BookMatePub v2 Reader – Classic Cream Parchment Theme (v2.0.0) */
:root{
  --bm2-bg:#F6F1E7;
  --bm2-text:#2B2B2B;
  --bm2-muted:#585858;
  --bm2-border:#D8CFBF;
  --bm2-btn:#EFE6D6;
  --bm2-btn-border:#CBBFA9;
  --bm2-shadow:rgba(0,0,0,0.08);
  --bm2-highlight:rgba(255, 235, 120, 0.55);
}

.bm2-wrap{
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 10px 24px;
  color: var(--bm2-text);
  background: var(--bm2-bg);
  border: 1px solid var(--bm2-border);
  box-shadow: 0 8px 24px var(--bm2-shadow);
}

@media (min-width: 900px){
  .bm2-wrap{ padding: 18px 22px 28px; }
}

.bm2-header{
  text-align: center;
  padding: 8px 6px 0;
}

.bm2-book-title{
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.bm2-chapter-title{
  margin-top: 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 600;
}

.bm2-divider{
  margin: 14px auto 10px;
  height: 1px;
  width: 86%;
  background: linear-gradient(to right, transparent, var(--bm2-border), transparent);
}

.bm2-main{ width: 100%; }

.bm2-content-frame{
  position: relative;
  width: 100%;
}

.bm2-content{
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.75;
  padding: 8px 6px 18px;
  outline: none;
}

@media (max-width: 600px){
  .bm2-content{ font-size: 20px; padding: 6px 4px 16px; }
  .bm2-book-title{ font-size: 26px; }
  .bm2-chapter-title{ font-size: 21px; }
}

.bm2-content p{ margin: 0 0 1.15em; }
.bm2-content img{ max-width: 100%; height: auto; }

.bm2-bottom{
  border-top: 1px solid var(--bm2-border);
  padding-top: 10px;
}

.bm2-controls{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 4px 0 6px;
}

.bm2-btn{
  appearance: none;
  border: 1px solid var(--bm2-btn-border);
  background: var(--bm2-btn);
  color: #000;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 18px;
  font-weight: 600;
  padding: 10px 14px;
  min-height: 52px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0,0,0,0.05);
}

/* Ensure tool buttons remain readable even if the theme overrides button colors */
.bm2-tool,
.bm2-list-item{
  color: #000;
}

/* Pen canvas (freehand) */
.bm2-pen-canvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.bm2-pen-active .bm2-pen-canvas{
  pointer-events: auto;
  cursor: crosshair;
}

/* Quiz settings row */
.bm2-quiz-settings{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin: 6px 0 10px;
}

.bm2-quiz-voicebar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 6px;
}

.bm2-voice-toggle{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.bm2-voice-status{
  font-size: 14px;
  font-weight: 700;
  color: var(--bm2-muted);
  min-height: 18px;
}

.bm2-quiz-nav{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 8px 0 8px;
}

.bm2-quiz-progressline{
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--bm2-muted);
  margin: 6px 0 10px;
}

.bm2-quiz-card{
  border: 1px solid var(--bm2-border);
  padding: 12px;
  background: #fff7ea;
}

.bm2-quiz-qnum{
  font-weight: 900;
  font-size: 18px;
}

.bm2-quiz-prompt{
  font-size: 18px;
  margin-top: 6px;
}

.bm2-quiz-row{
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

.bm2-quiz-row-wrap{
  flex-wrap: wrap;
}

.bm2-quiz-feedback{
  margin-top: 8px;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  min-height: 22px;
}

.bm2-btn:disabled{
  opacity: 0.55;
  cursor: not-allowed;
}

.bm2-btn:active{ transform: translateY(1px); }

.bm2-more{
  background: #e9dcc6;
}

.bm2-status{
  text-align: center;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 16px;
  color: var(--bm2-muted);
  padding: 4px 0 2px;
}

.bm2-dot{ margin: 0 8px; }

/* Modals */
.bm2-modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 99999;
}

.bm2-modal[aria-hidden="false"]{ display: flex; }

.bm2-modal-card{
  width: min(720px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--bm2-bg);
  border: 1px solid var(--bm2-border);
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  padding: 14px 14px 16px;
}

.bm2-modal-title{
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin: 6px 0 12px;
}

.bm2-modal-list{
  display: grid;
  gap: 10px;
}

.bm2-list-item{
  border: 1px solid var(--bm2-btn-border);
  background: #fff7ea;
  padding: 12px 12px;
  min-height: 52px;
  font-size: 18px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.bm2-tools-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 720px){
  .bm2-tools-grid{ grid-template-columns: 1fr 1fr; }
}

.bm2-tool{
  border: 1px solid var(--bm2-btn-border);
  background: #fff7ea;
  padding: 12px 12px;
  min-height: 52px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.bm2-close{
  width: 100%;
  margin-top: 12px;
}

/* TTS */
.bm2-tts-row{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}

.bm2-label{
  font-size: 18px;
  font-weight: 700;
}

.bm2-select{
  min-height: 52px;
  font-size: 18px;
  padding: 8px 10px;
  border: 1px solid var(--bm2-btn-border);
  background: #fff;
  min-width: 240px;
}

/* Highlight markup */
.bm2-hl{
  background: var(--bm2-highlight);
  padding: 0 2px;
  border-radius: 4px;
}

.bm2-note-marker{
  display: inline-block;
  margin-left: 6px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border: 1px solid var(--bm2-btn-border);
  background: #fff;
  padding: 2px 6px;
  border-radius: 999px;
}

/* Stamps */
.bm2-stamps-layer{
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bm2-stamp{
  position: absolute;
  pointer-events: auto;
  min-width: 42px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  border: 2px solid #7b6a4c;
  background: rgba(255,255,255,0.85);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  cursor: pointer;
}
