:root {
  --bg: #ffffff;
  --fg: #111111;
  --line: #e8e8e8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  cursor: default;
}

button,
a,
canvas {
  -webkit-tap-highlight-color: transparent;
}

.app {
  width: 100%;
  min-height: 100vh;
  padding: 2px 4px 6px;
}

.topbar {
  width: 100%;
  margin-bottom: 8px;
}

.index-line {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.index-line a {
  color: var(--fg);
  opacity: 0.7;
}

.filename {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: var(--fg);
  font-size: 13px;
  line-height: 1.2;
  text-align: left;
  cursor: default;
  opacity: 0.7;
}

.viewer-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.viewer {
  position: relative;
  width: min(66.666vw, 1180px);
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #fff;
}

.pdf-canvas {
  display: none;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.status {
  font-size: 13px;
  line-height: 1.4;
  padding: 12px;
}

.nav-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg);
  padding: 0;
  font-size: 18px;
  line-height: 1;
  cursor: default;
  opacity: 0.7;
}

.controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.page-indicator {
  font-size: 12px;
  line-height: 1;
  user-select: none;
  opacity: 0.7;
}

.download {
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--fg);
  opacity: 0.7;
  font-size: 18px;
  line-height: 1;
  min-width: 36px;
  min-height: 36px;
  padding: 10px;
}

.filename:hover,
.index-line a:hover,
.nav-btn:hover,
.download:hover {
  opacity: 1;
}

.hotzone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  border: 0;
  background: transparent;
  cursor: default;
  padding: 0;
  z-index: 2;
}

.hotzone-left {
  left: 0;
}

.hotzone-right {
  right: 0;
}

@media (max-width: 900px) {
  .app {
    padding: 2px 3px 5px;
  }

  .viewer {
    width: 100%;
    min-height: 220px;
  }

  .download {
    right: 0;
    bottom: 0;
  }
}
