/* Phone view */
@media (max-width: 768px) and (pointer: coarse) {
  html, body {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  #sheet {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: visible !important;
  }

  #titlebar,
  #navcol,
  #adcol,
  .cle-share-bar {
    display: none !important;
  }

  #main {
    width: 100% !important;
    margin: 0 !important;
    padding-bottom: 70px !important;
    box-sizing: border-box;
    overflow-x: auto !important;
    max-width: 100% !important;
  }

  #main img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  .author-photo {
    width: 120px !important;
    height: 120px !important;
    overflow: hidden !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
  }

  .author-photo img {
    width: 120px !important;
    height: 120px !important;
    max-width: 120px !important;
    object-fit: cover !important;
    object-position: center 25% !important;
  }

  .cle-author-box {
    max-width: 100% !important;
    width: auto !important;
    margin: 12px 8px !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .author-box-title {
    font-size: 1.55rem !important;
    line-height: 1.25 !important;
    padding: 12px 10px !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  .author-box-subtitle {
    font-size: 1.05rem !important;
    padding: 0 6px !important;
  }

  .author-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .author-actions .btn-action,
  .author-actions .support-link {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    justify-content: center !important;
  }

  .booktoc-wrapper {
    max-width: 100% !important;
    margin: 20px 8px !important;
    box-sizing: border-box !important;
  }

  .booktoc-box {
    padding: 18px 12px !important;
    box-sizing: border-box !important;
  }

  .booktoc-intro .booktoc-entry {
    font-size: 1.35rem !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .booktoc-title,
  .booktoc-subtitle,
  .booktoc-number {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  p#scripture {
    max-width: 100% !important;
    margin: 16px 0 !important;
    padding: 10px 8px !important;
    box-sizing: border-box !important;
  }

  p#def {
    margin: 12px 0 14px 8px !important;
    padding-left: 8px !important;
    box-sizing: border-box !important;
  }

  #head {
    max-width: 100% !important;
    width: auto !important;
    margin: 14px 0 8px !important;
    padding: 12px 10px !important;
    box-sizing: border-box !important;
  }

  #head .headtext {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .chalkboard-note {
    width: auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .chalkboard-note br {
    display: none !important;
  }

  .cle-list {
    max-width: 100% !important;
    margin: 16px 0 !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
    box-sizing: border-box !important;
  }

  ul.cle-list {
    padding-left: 18px !important;
    margin: 0 !important;
  }

  .cle-list li {
    margin-left: 0 !important;
  }

  ref {
    display: inline !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .cle-table-scroll {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .cle-table-scroll table,
  #main table {
    width: max-content !important;
    max-width: none !important;
  }

  .cle-phone-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #000;
    border-top: 1px solid #333;
    justify-content: space-around;
    align-items: center;
    height: 56px;
    padding: 0 6px;
  }

  .cle-phone-bar a {
    color: #ffd700 !important;
    text-decoration: none !important;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 8px 10px;
    min-width: 0;
  }

  .bible-book-title h2 {
    white-space: normal !important;
    font-size: 1.35rem !important;
    overflow-wrap: anywhere !important;
  }

  .bible-nav-btn {
    min-width: 0 !important;
    padding: 8px 10px !important;
    font-size: 0.9rem !important;
  }

  .bible-sticky-nav {
    z-index: 10002 !important;
  }

  .bible-sticky-nav.active {
    height: auto !important;
    min-height: 52px !important;
  }

  .sticky-inner {
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    gap: 6px !important;
    padding: 6px 8px !important;
    font-size: 0.85rem !important;
  }

  .sticky-title .book-name {
    font-size: 0.95rem !important;
  }

  .sticky-title .sticky-intro {
    display: none !important;
  }

  .sticky-btn,
  .chapters-btn {
    padding: 6px 8px !important;
    min-width: 0 !important;
    font-size: 0.8rem !important;
  }

  .chapters-menu {
    left: 8px !important;
    right: 8px !important;
    min-width: 0 !important;
    max-height: 50vh !important;
  }
}

@media (hover: hover) and (pointer: fine) {
  .cle-phone-bar {
    display: none !important;
  }
}




@media (max-width: 800px) {
.cle-table-wrap { width: 100% !important; max-width: 100% !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
.cle-table-wrap .cle-table { width: max-content !important; min-width: 100% !important; max-width: none !important; table-layout: auto !important; }
.cle-table-wrap .cle-table td { width: auto !important; white-space: nowrap !important; }

.cle-table-wrap[style*="width:40%"],
.cle-table-wrap[style*="width:45%"],
.cle-table-wrap[style*="width:50%"],
.cle-table-wrap[style*="width:55%"],
.cle-table-wrap[style*="width:60%"],
.cle-table-wrap[style*="width:65%"],
.cle-table-wrap[style*="width:70%"] { overflow-x: visible !important; }
.cle-table-wrap[style*="width:40%"] .cle-table,
.cle-table-wrap[style*="width:45%"] .cle-table,
.cle-table-wrap[style*="width:50%"] .cle-table,
.cle-table-wrap[style*="width:55%"] .cle-table,
.cle-table-wrap[style*="width:60%"] .cle-table,
.cle-table-wrap[style*="width:65%"] .cle-table,
.cle-table-wrap[style*="width:70%"] .cle-table { width: 100% !important; min-width: 0 !important; max-width: 100% !important; table-layout: fixed !important; }
.cle-table-wrap[style*="width:40%"] td,
.cle-table-wrap[style*="width:45%"] td,
.cle-table-wrap[style*="width:50%"] td,
.cle-table-wrap[style*="width:55%"] td,
.cle-table-wrap[style*="width:60%"] td,
.cle-table-wrap[style*="width:65%"] td,
.cle-table-wrap[style*="width:70%"] td { white-space: normal !important; overflow-wrap: anywhere; }

.cle-table-wrap:has(tr:only-child td:only-child) { overflow-x: visible !important; }
.cle-table-wrap:has(tr:only-child td:only-child) .cle-table { width: 100% !important; min-width: 0 !important; max-width: 100% !important; table-layout: fixed !important; }
.cle-table-wrap:has(tr:only-child td:only-child) td { white-space: normal !important; overflow-wrap: anywhere; }
}

.article-read img[style*="width: 10%"],
.article-read img[style*="width:10%"],
.article-read img[style*="width: 15%"],
.article-read img[style*="width:15%"],
.article-read img[style*="width: 20%"],
.article-read img[style*="width:20%"],
.article-read img[style*="width: 25%"],
.article-read img[style*="width:25%"],
.article-read img[style*="width: 30%"],
.article-read img[style*="width:30%"],
.article-read img[style*="width: 35%"],
.article-read img[style*="width:35%"],
.article-read img[style*="width: 40%"],
.article-read img[style*="width:40%"] { width: 68% !important; max-width: 280px; height: auto !important; }

.article-read ul.cle-list,
.article-read ol.cle-list {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 28px !important;
}
.article-read div.cle-list {
  margin-left: auto !important;
  margin-right: auto !important;
}

@media (max-width: 900px) {
  .night-toggle, .cle-share-wheel { display: none !important; }
  .mobile-ui-toggle { display: flex !important; position: fixed; left: 12px; bottom: 16px; z-index: 10002; width: 40px; height: 40px; border-radius: 50%; background: #0b1020; color: #FFD700; border: 1px solid #FFD700; font-size: 1.2rem; align-items: center; justify-content: center; }
.mobile-ui-toggle { width: 44px !important; height: 44px !important; font-size: 1.2rem !important; }
  body.ui-open .night-toggle { display: inline-flex !important; bottom: 64px !important; }
  body.ui-open .cle-share-wheel { display: block !important; bottom: 112px !important; }
}
@media (min-width: 901px) {
  .mobile-ui-toggle { display: none !important; }
}