.app-message {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
.app-message-inner {
  max-width: 420px;
  text-align: center;
}
.app-message-icon {
  font-size: 44px;
  margin-bottom: 12px;
}
.app-message-inner h2 {
  font-family: 'GFS Didot', Georgia, serif;
  font-size: 26px;
  font-weight: normal;
  margin: 0 0 12px;
}
.app-message-inner p {
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 22px;
  opacity: 0.85;
  text-align: center;
}
.app-btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #ffe5a6 0%, #c9b077 52%, #937b48 100%);
  color: #1a1a1a;
}
.app-btn-ghost {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  opacity: 0.75;
}
.app-btn + .app-btn {
  margin-left: 10px;
}

.epub-rich {
  display: block;
  max-width: 720px;
  margin: 0 auto;
}
.epub-rich.epub-kind-cover {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toc-entry.toc-locked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0.6;
}
.toc-entry .toc-lock {
  font-size: 13px;
  margin-left: 10px;
}

body.reader.darkmode .app-message-inner {
  color: #e8e8e8;
}

.app-unlock {
  text-align: center;
}
.app-unlock-intro {
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 16px;
  opacity: 0.85;
}
.app-unlock-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  font-size: 15px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.6);
}
body.reader.darkmode .app-unlock-input {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: #f0f0f0;
}
.app-unlock-msg {
  margin-top: 12px;
  font-size: 13px;
  min-height: 18px;
  opacity: 0.85;
}
.app-unlock-msg.is-error {
  color: #c0392b;
  opacity: 1;
}
body.reader.darkmode .app-unlock-msg.is-error {
  color: #ff8a7a;
}
.app-unlock-devices {
  margin-top: 14px;
  text-align: left;
}
.app-device-list-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: 8px;
}
.app-device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  gap: 12px;
}
.app-device-name {
  font-size: 14px;
}
.app-bm-empty {
  opacity: 0.6;
  font-size: 14px;
  text-align: center;
  padding: 16px 0;
}
.app-bm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.app-bm-label {
  flex: 1;
  cursor: pointer;
  font-size: 14px;
}
.app-bm-del {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.55;
}
.app-bm-del:hover { opacity: 1; }

.app-library {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}
.app-lib-header { margin-bottom: 28px; }
.app-lib-h1 {
  font-family: 'GFS Didot', Georgia, serif;
  font-weight: normal;
  font-size: 38px;
  margin: 6px 0 0;
  color: #2f2a25;
}
.app-lib-section { margin: 40px 0; }
.app-lib-section-title {
  font-family: 'GFS Didot', Georgia, serif;
  font-weight: normal;
  font-size: 28px;
  margin: 4px 0 6px;
  color: #2f2a25;
  border: none;
  padding: 0;
}
.app-lib-section-sub {
  margin: 0 0 18px;
  color: #665d54;
  font-size: 15px;
  line-height: 1.55;
}
.app-lib-loading {
  display: flex;
  justify-content: center;
  padding: 60px 0;
}
.app-lib-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, 0.12);
  border-top-color: #937b48;
  animation: app-spin 0.9s linear infinite;
}
@keyframes app-spin { to { transform: rotate(360deg); } }
.app-import-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.app-import-btn { cursor: pointer; }
.app-import-status {
  font-size: 13px;
  color: #665d54;
}
.app-dossier-actions {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.app-dossier-actions .app-btn {
  text-decoration: none;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.modal-content {
  background: #fff;
  padding: 24px;
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: 6px;
  position: relative;
  font-family: 'Open Sans', sans-serif;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 28px;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
}
.modal-content p { margin: 0 0 1em; }

.cover-only-card {
  position: relative;
}
.app-card-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  display: none;
}
.cover-only-card:hover .app-card-remove { display: block; }
@media (hover: none) {
  .app-card-remove { display: block; }
}

#pages.rdr-host {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  line-height: normal;
}
#pages.rdr-host .rdr-frame {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
