:root {
  --toolbar-height: 70px;
  --toolbar-bg: #10233f;
  --surface: #d9dde3;
  --text: #fff;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { font-family: Arial, Helvetica, sans-serif; background: var(--surface); }
.toolbar {
  height: var(--toolbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 18px;
  background: #114903;
  color: var(--text);
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  position: relative;
  z-index: 10;
}
.brand img {
  display: block;
  max-width: 210px;
  max-height: 50px;
  object-fit: contain;
  border-radius: 4px;
  padding: 3px 6px;
}
.controls { display: flex; align-items: center; gap: 7px; }
.controls button, .controls .button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 6px;
  color: #fff;
  background: rgba(255,255,255,.1);
  font-size: 20px;
  text-decoration: none;
  cursor: pointer;
}
.controls button:hover, .controls .button:hover { background: rgba(255,255,255,.22); }
#page-status { min-width: 72px; text-align: center; font-size: 14px; font-weight: 700; }
#viewer-wrap {
  height: calc(100vh - var(--toolbar-height));
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 14px;
  touch-action: pan-x pan-y;
}
#book { margin: auto; transform-origin: center center; transition: transform .15s ease; }
.page {
  background: #fff;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.page canvas { width: 100%; height: 100%; display: block; object-fit: contain; background: #fff; }
#loading {
  position: absolute;
  padding: 12px 18px;
  border-radius: 8px;
  background: rgba(16,35,63,.92);
  color: white;
  font-weight: 700;
  z-index: 5;
}
@media (max-width: 700px) {
  :root { --toolbar-height: 60px; }
  .toolbar { padding: 6px 8px; gap: 8px; }
  .brand img { max-width: 126px; max-height: 42px; }
  .controls { gap: 4px; }
  .controls button, .controls .button { width: 32px; height: 34px; font-size: 17px; }
  #page-status { min-width: 54px; font-size: 12px; }
  #viewer-wrap { padding: 6px; }
}
@media (max-width: 430px) {
  #zoom-out, #zoom-in { display: none; }
  .brand img { max-width: 105px; }
}
