html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  background: #111;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #111;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 56px;
}

#bookTitle {
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

button {
  appearance: none;
  border: 0;
  background: #2a2a2a;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

button:hover {
  background: #3a3a3a;
}

button:disabled {
  opacity: 0.4;
  cursor: default;
}

#pageIndicator {
  font-size: 14px;
  opacity: 0.85;
  min-width: 110px;
  text-align: center;
}

#status {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px;
  text-align: center;
}

#status.hidden {
  display: none;
}

#bookContainer {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #111;
  position: relative;
}

#bookContainer.hidden {
  display: none;
}

#book {
  max-width: 100%;
  max-height: 100%;
  overflow: hidden !important;
}

.page {
  background: #222;
  overflow: hidden !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-inner {
  width: 100%;
  height: 100%;
  overflow: hidden !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.page-inner canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.stf__parent {
  overflow: hidden !important;
}

.stf__wrapper {
  overflow: hidden !important;
}

.stf__block {
  overflow: hidden !important;
}

@media (max-width: 900px) {
  .topbar {
    padding: 10px 12px;
    min-height: 52px;
  }

  #bookTitle {
    font-size: 14px;
  }

  #pageIndicator {
    min-width: auto;
    font-size: 13px;
  }

  button {
    padding: 7px 10px;
    font-size: 13px;
  }

  #bookContainer {
    padding: 10px;
  }
}