* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: transparent;
}

body {
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.topbar {
  height: 64px;
  background: #00897b;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: 0 2px 5px rgba(0,0,0,.2);
  z-index: 20;
}

.app-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .5px;
  font-family:
    "Noto Sans SC",
    "PingFang SC",
    "Microsoft YaHei",
    "Noto Sans TC",
    sans-serif;
}

.menu-btn {
  background: transparent;
  border: 0;
  color: white;
  font-size: 28px;
  line-height: 1;
  padding: 8px;
  cursor: pointer;
}

.menu-popup {
  position: absolute;
  right: 10px;
  top: 56px;
  min-width: 190px;
  background: #000;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  display: none;
  overflow: hidden;
  z-index: 50;
}

.menu-popup.show {
  display: block;
}

.menu-popup button {
  width: 100%;
  display: block;
  padding: 14px 18px;
  background: transparent;
  color: #fff;
  border: 0;
  text-align: left;
  font-size: 15px;
}

.content {
  padding: 24px 16px 18px;
  margin-top: 64px;
}

#copySutraBtn {
  margin-left: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 18px;
}

/* Wider screens → 3 thumbnails */
@media (min-width: 800px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 5px 14px rgba(0,0,0,.18);
  text-decoration: none;
  color: inherit;
  display: block;
  touch-action: manipulation;
}

.card.dragging {
  opacity: .55;
  transform: scale(.97);
}

.card.reorder-mode {
  outline: 2px dashed #00897b;
  cursor: grab;
}

.card img {
  width: 100%;
  height: 132px;
  display: block;
  object-fit: cover;
  background: #eee;
}

.card-body {
  min-height: 82px;
  padding: 12px 14px 13px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: #202124;
  margin-bottom: 5px;
}

.card-subtitle {
  font-size: 14px;
  color: #777;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reorder-toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(0,0,0,.75);
  color: white;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 80;
  display: none;
}

.reorder-toast.show {
  display: block;
}

.bottom-nav {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(6px + env(safe-area-inset-bottom));

  min-height: 70px;
  padding: 7px;

  border-radius: 34px;

  display: grid;
  grid-template-columns: repeat(4, 1fr);

  z-index: 20;

  transition:
    background .25s ease,
    border .25s ease,
    box-shadow .25s ease,
    backdrop-filter .25s ease,
    -webkit-backdrop-filter .25s ease;
}

.bottom-nav.clear-mode {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
}

.bottom-nav.tinted-mode {
  background: rgba(230,230,230,.55);
  border: 1px solid rgba(255,255,255,0.24);
  box-shadow:
    0 8px 24px rgba(0,0,0,.12),
    inset 0 1px 0 rgba(255,255,255,.25);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  backdrop-filter: blur(30px) saturate(170%);
}


html.ios-device .bottom-nav {
  bottom: calc(-16px + env(safe-area-inset-bottom));
}

.nav-item {
  text-decoration: none;
  color: #202124;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 28px;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nav-icon {
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
}

.home-page .active-home,
.recital-page .active-recital,
.training-page .active-training {
  color: #2f80ed;
  background: rgba(210, 212, 218, .65);
}

.nav-item:active {
  transform: scale(.96);
}

/* Recital page */
.recital-page {
  min-height: 100vh;
  background: url("assets/recitalbgimage1.jpg") center center / cover no-repeat fixed;
  overflow: hidden;
}

.recital-content {
  min-height: calc(100vh - 64px - 74px);
  margin-top: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.counter-area {
  text-align: center;
  width: 100%;
  transform: translateY(215px);
}

.chant-count {
  color: white;
  font-size: 54px;
  font-weight: 700;
  text-shadow: 0 2px 5px rgba(0,0,0,.35);
  margin-bottom: 34px;
}

.chant-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.chant-btn {
  background: #00897b;
  color: white;
  border: 0;
  border-radius: 4px;
  font-size: 18px;
  padding: 12px 62px;
  min-width: 260px;
  box-shadow: 0 2px 4px rgba(0,0,0,.25);
}



@media (max-width: 420px) {
  .topbar {
    height: 58px;
  }

  .app-title {
    font-size: 20px;
  }

.content {
  margin-top: 58px;
  padding: 22px 14px 120px;
}

  .grid {
    gap: 26px 16px;
  }

  .card img {
    height: 126px;
  }

  .card-body {
    min-height: 78px;
    padding: 11px 13px 12px;
  }

  .card-title {
    font-size: 19px;
  }

  .card-subtitle {
    font-size: 15px;
  }

  .recital-content {
    margin-top: 58px;
    min-height: calc(100vh - 58px - 74px);
  }

  .counter-area {
    transform: translateY(90px);
  }

  .chant-count {
    font-size: 48px;
  }

  .chant-btn {
    font-size: 20px;
    min-width: 220px;
    padding: 10px 34px;
  }

  

  .bottom-nav {
    left: 12px;
    right: 12px;
    min-height: 68px;
    padding: 6px;
  }

  .nav-item {
    font-size: 12px;
  }

  .nav-icon {
    font-size: 27px;
  }
}


/* Buddha name popup for nav2 */
.buddha-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.58);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.buddha-dialog-backdrop.show {
  display: flex;
}

.buddha-dialog {
  width: min(92vw, 560px);
  background: #fff;
  color: #222;
  border-radius: 3px;
  padding: 34px 40px 26px;
  box-shadow: 0 10px 35px rgba(0,0,0,.35);
}

.buddha-dialog h2 {
  font-size: 26px;
  font-weight: 400;
  margin: 0 0 34px;
}

.buddha-dialog label {
  display: block;
  font-size: 22px;
  margin-bottom: 24px;
}

.buddha-dialog input {
  width: 100%;
  border: 0;
  border-bottom: 2px solid #777;
  outline: none;
  font-size: 26px;
  padding: 0 4px 8px;
  background: transparent;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 34px;
  margin-top: 34px;
}

.dialog-actions button {
  border: 0;
  background: transparent;
  color: #00897b;
  font-size: 22px;
  font-weight: 700;
  padding: 8px 0;
  cursor: pointer;
}

@media (max-width: 420px) {
  .buddha-dialog {
    padding: 28px 34px 22px;
  }

  .buddha-dialog h2 {
    font-size: 24px;
    margin-bottom: 30px;
  }

  .buddha-dialog label {
    font-size: 20px;
    margin-bottom: 22px;
  }

  .buddha-dialog input {
    font-size: 24px;
  }

  .dialog-actions button {
    font-size: 20px;
  }
}


/* Hide scrollbar for nav1 */
body.home-page .content {
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding-bottom: 120px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

body.home-page .content::-webkit-scrollbar {
  display: none;
}


/* Reader page */
.reader-page {
  background: #fff;
}

.reader-content {
  margin-top: 64px;
  height: calc(100vh - 64px);
  overflow: hidden;
  background: #fff;
  padding-bottom: calc(90px + env(safe-area-inset-bottom));
}

.reader-header {
  padding: 22px 28px 10px;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.reader-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.reader-title {
  color: #c89024;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
}

.reader-subtitle {
  color: #777;
  font-size: 17px;
  margin-top: 8px;
}

.open-external {
  color: #2196c9;
  font-size: 17px;
  text-decoration: none;
  white-space: nowrap;
  padding-top: 6px;
}

.reader-frame {
  width: 100%;
  height: calc(100% - 94px);
  border: 0;
  display: block;
  background: #fff;
}

.reader-fallback {
  padding: 20px 28px;
  font-size: 18px;
}

@media (max-width: 420px) {
  .reader-content {
  margin-top: 58px;
  height: calc(100vh - 58px);
  padding-bottom: calc(90px + env(safe-area-inset-bottom));
}
  .reader-header {
    padding: 18px 28px 8px;
  }

  .reader-title {
    font-size: 22px;
  }

  .reader-subtitle {
    font-size: 16px;
  }

  .reader-frame {
    height: calc(100% - 88px);
  }
}


/* Reader font-size popup */
.font-popup {
  position: absolute;
  right: 10px;
  top: 56px;
  width: 260px;
  background: #fff;
  color: #222;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
  padding: 18px 18px 14px;
  display: none;
  z-index: 120;
}

.font-popup.show {
  display: block;
}

.font-popup-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.font-popup input[type="range"] {
  width: 100%;
  accent-color: #00897b;
}

.font-size-row {
  display: flex;
  justify-content: space-between;
  color: #666;
  font-size: 14px;
  margin-top: 8px;
}


/* Reader loaded HTML text content */
.reader-text-content {
  height: calc(100% - 94px);
  overflow-y: auto;
  padding: 22px 28px 120px;
  background: #fff;
  color: #222;
  font-size: var(--reader-font-size, 20px);
  line-height: 1.75;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.reader-text-content::-webkit-scrollbar {
  display: none;
}

.reader-text-content * {
  font-size: inherit !important;
  line-height: inherit !important;
  max-width: 100%;
}

.reader-text-content img {
  height: auto;
}

.reader-text-content:empty {
  display: none;
}

.reader-frame.hidden {
  display: none;
}

@media (max-width: 420px) {
  .reader-text-content {
    height: calc(100% - 88px);
    padding: 20px 24px 32px;
  }
}


/* Embedded PDF viewer */
.pdf-viewer {
  height: calc(100% - 94px);
  overflow-y: auto;
  padding: 14px 10px 28px;
  background: #f2f2f2;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.pdf-viewer::-webkit-scrollbar {
  display: none;
}

.pdf-viewer:empty {
  display: none;
}

.pdf-page-canvas {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto 14px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

.pdf-message {
  padding: 30px 20px;
  text-align: center;
  color: #555;
  font-size: 16px;
}

@media (max-width: 420px) {
  .pdf-viewer {
    height: calc(100% - 88px);
  }
}


/* Horizontal PDF swipe */
.pdf-viewer {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 10px;
  padding: 10px;
  height: calc(100% - 94px);
}

.pdf-page-canvas {
  flex: 0 0 100%;
  scroll-snap-align: center;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}


/* FINAL FIX: PDF horizontal swipe mode */
.pdf-viewer {
  height: calc(100% - 94px) !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: row !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory !important;
  scroll-behavior: smooth !important;
  gap: 0 !important;
  padding: 0 !important;
  background: #f2f2f2 !important;
  -webkit-overflow-scrolling: touch !important;
}

.pdf-page-wrapper {
  flex: 0 0 100% !important;
  width: 100% !important;
  min-width: 100% !important;
  height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scroll-snap-align: start !important;
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
  padding: 14px 10px 30px !important;
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

.pdf-page-wrapper::-webkit-scrollbar {
  display: none !important;
}

.pdf-page-canvas {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0 auto !important;
  background: white !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.18) !important;
}

@media (max-width: 420px) {
  .pdf-viewer {
    height: calc(100% - 88px) !important;
  }
}


/* Mobile reorder support */
.card.reorder-mode {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.card-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: .85;
  transform: scale(.98);
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
}


/* Reader opening / dedication options */
.reader-options-popup {
  width: 280px;
}

.font-setting-block {
  margin-bottom: 14px;
}

.font-setting-label {
  font-size: 15px;
  margin-bottom: 10px;
  color: #333;
}

.reader-option-btn {
  width: 100%;
  display: block;
  border: 0;
  background: #fff;
  color: #222;
  text-align: left;
  font-size: 17px;
  padding: 14px 4px;
  border-top: 1px solid #eee;
  cursor: pointer;
}

.reader-option-btn:active {
  background: #f2f2f2;
}

.text-editor-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.58);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 160;
}

.text-editor-backdrop.show {
  display: flex;
}

.text-editor-dialog {
  width: min(92vw, 560px);
  background: #fff;
  color: #222;
  border-radius: 5px;
  padding: 26px 26px 18px;
  box-shadow: 0 10px 35px rgba(0,0,0,.35);
}

.text-editor-dialog h2 {
  margin: 0 0 18px;
  font-size: 24px;
  font-weight: 500;
}

.text-editor-dialog textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 12px;
  font-size: 18px;
  line-height: 1.55;
  font-family: Arial, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

.reader-custom-text {
  white-space: pre-wrap;
  color: #7a4f00;
  background: #fff8e1;
  border-left: 4px solid #c89024;
  padding: 14px 16px;
  margin: 0 0 20px;
  border-radius: 4px;
}

.reader-custom-text.after {
  margin: 24px 0 0;
}

@media (max-width: 420px) {
  .text-editor-dialog {
    padding: 24px 22px 16px;
  }

  .text-editor-dialog textarea {
    min-height: 170px;
    font-size: 17px;
  }
}


/* Training records page */
.training-page {
  background: #fff;
}

.training-content {
  margin-top: 64px;
  min-height: calc(100vh - 64px);
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding-bottom: calc(120px + env(safe-area-inset-bottom));
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.training-content::-webkit-scrollbar {
  display: none;
}

.training-list {
  display: flex;
  flex-direction: column;
}

.training-card {
  position: relative;
  min-height: 250px;
  background-size: cover;
  background-position: center;
  border: 0;
  text-align: left;
  color: #fff;
  overflow: hidden;
  cursor: pointer;
}

.training-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.28);
}

.training-card-content {
  position: relative;
  z-index: 1;
  padding: 34px 28px;
  text-shadow: 0 2px 5px rgba(0,0,0,.55);
}

.training-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
}

.training-desc {
  font-size: 18px;
  line-height: 1.55;
  font-weight: 500;
}

.training-confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 180;
}

.training-confirm-backdrop.show {
  display: flex;
}

.training-confirm-dialog {
  width: min(90vw, 520px);
  background: #fff;
  color: #222;
  border-radius: 4px;
  padding: 28px 32px 20px;
  box-shadow: 0 10px 35px rgba(0,0,0,.35);
}

.training-confirm-dialog h2 {
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: 500;
}

.training-confirm-dialog p {
  font-size: 20px;
  line-height: 1.5;
  margin: 0;
}

.training-page .active-training {
  color: #2f80ed;
  font-weight: 700;
}



@media (max-width: 420px) {
  .training-content {
    margin-top: 58px;
    height: calc(100vh - 58px - 74px);
  }

  .training-card {
    min-height: 250px;
  }

  .training-card-content {
    padding: 34px 28px;
  }

  .training-title {
    font-size: 28px;
  }

  .training-desc {
    font-size: 20px;
    line-height: 1.5;
  }
}

/* PDF loading popup */
.pdf-loading-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.pdf-loading-popup.show {
  display: flex;
}

.pdf-loading-box {
  background: #fff;
  padding: 24px 28px;
  border-radius: 6px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.loading-text {
  margin-top: 12px;
  font-size: 16px;
  color: #333;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #ccc;
  border-top-color: #00897b;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-progress {
  margin-top: 8px;
  font-size: 20px;
  font-weight: bold;
  color: #00897b;
}


/* Better PDF bookmark loading message */
.pdf-loading-box {
  max-width: 320px;
}

.loading-text {
  line-height: 1.5;
}


/* Reader bookmark options */
.pdf-only-option,
.bookmark-option {
  display: block;
}

.reader-page.pdf-mode #editOpeningBtn,
.reader-page.pdf-mode #editDedicationBtn {
  display: none;
}

.bookmark-toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(0,0,0,.78);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 15px;
  z-index: 99999;
  display: none;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}

.bookmark-toast.show {
  display: block;
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}


/* PDF mode: no font-size adjustment */
.reader-page.pdf-mode .font-setting-block {
  display: none;
}


.reset-chant-btn {
  background: red;
  color: white;
  border-radius: 6px;
  padding: 10px 18px;
  box-shadow: 0 2px 4px rgba(0,0,0,.25);
  font-size: 18px;
  border: none;
  cursor: pointer;
}

.reset-chant-btn:hover {
  background: darkred;
}

/* Hide scrollbar on home page while keeping the thumbnail list scrollable */
body.home-page {
  height: 100vh;
  overflow: hidden;
}

body.home-page::-webkit-scrollbar,
body.home-page .content::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body.home-page .content {
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}


.menu-popup button:focus,
.menu-popup button:active {
  outline: none;
  background: rgba(255,255,255,.12);
  color: #fff;
}


/* Light / Dark mode toggle */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle-btn {
  appearance: none;
  -webkit-appearance: none;

  height: 38px;
  padding: 0 14px;

  border: 0;
  border-radius: 10px;

  background: rgba(255,255,255,.18);
  color: #fff;

  font-size: 15px;
  font-weight: 600;

  cursor: pointer;
  white-space: nowrap;

  display: flex;
  align-items: center;
  justify-content: center;

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  -webkit-tap-highlight-color: transparent;
}

.theme-toggle-btn:active {
  opacity: .8;
}

.theme-toggle-btn:active {
  transform: scale(.96);
}

html.dark-mode,
body.dark-mode {
  background: #121212;
  color: #f1f1f1;
}

body.dark-mode .topbar {
  background: #00574f;
  box-shadow: 0 2px 8px rgba(0,0,0,.55);
}

body.dark-mode .content {
  color: #f1f1f1;
}

body.dark-mode .card {
  background: #1f1f1f;
  color: #f1f1f1;
  box-shadow: 0 5px 16px rgba(0,0,0,.55);
}

body.dark-mode .card-title {
  color: #ffffff;
}

body.dark-mode .card-subtitle {
  color: #c9c9c9;
}

body.dark-mode .card img {
  background: #2a2a2a;
}

body.dark-mode .bottom-nav.clear-mode {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
}

body.dark-mode .bottom-nav.tinted-mode {
  background: rgba(40,40,40,.55);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 8px 24px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.08);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  backdrop-filter: blur(30px) saturate(170%);
}

body.dark-mode .nav-item {
  color: #f1f1f1;
}

body.dark-mode .home-page .active-home,
body.dark-mode .recital-page .active-recital,
body.dark-mode .training-page .active-training,
body.dark-mode.home-page .active-home,
body.dark-mode.recital-page .active-recital,
body.dark-mode.training-page .active-training {
  color: #8ab4ff;
  background: rgba(255,255,255,.12);
}

body.dark-mode .menu-popup {
  background: #232323;
  color: #fff;
}

/* Fix: keep nav2 recital page background image even when dark mode is enabled */
body.dark-mode.recital-page {
  background: url("assets/recitalbgimage1.jpg") center center / cover no-repeat fixed;
}


/* Pull-down refresh spinner above thumbnails */
.pull-refresh-spinner {
  width: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 0 0 14px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.pull-refresh-spinner.show {
  display: flex;
}

.pull-refresh-spinner-circle {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(128,128,128,0.35);
  border-top-color: #00897b;
  border-radius: 50%;
  animation: pullRefreshSpin 0.8s linear infinite;
}

body.dark-mode .pull-refresh-spinner-circle {
  border-color: rgba(255,255,255,0.28);
  border-top-color: #8ab4ff;
}

@keyframes pullRefreshSpin {
  to { transform: rotate(360deg); }
}

/* Disable text selection / long press */
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}


#copySutraBtn{
  margin-left:8px;
}

body.reader-page {
  padding-bottom: 0 !important;
  height: 100vh;
  overflow: hidden;
  background: #fff;
}

body.reader-page .reader-content {
  height: calc(100vh - 64px) !important;
  padding-bottom: 0 !important;
  overflow: hidden;
}

@media (max-width: 420px) {
  body.reader-page .reader-content {
    height: calc(100vh - 58px) !important;
    padding-bottom: 0 !important;
  }
}