/* Sabato Studio Overview flipbook chrome */
:root {
  --bg: #161514;
  --bg-soft: #1d1c1a;
  --ink: #ebe6de;
  --ink-muted: rgba(235, 230, 222, 0.58);
  --line: rgba(235, 230, 222, 0.12);
  --btn-hover: rgba(235, 230, 222, 0.08);
  --toolbar-h: 56px;
  --pad: 24px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 50% 40%, #221f1c 0%, var(--bg) 62%);
}

.stage {
  flex: 1 1 auto;
  position: relative;
  width: 100%;
  min-height: 0;
  padding: var(--pad);
  display: flex;
  align-items: center;
  justify-content: center;
}

.book {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

.book .page {
  width: 100%;
  height: 100%;
  background: #111;
  overflow: hidden;
}

.book .page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.toolbar {
  flex: 0 0 var(--toolbar-h);
  height: var(--toolbar-h);
  display: grid;
  grid-template-columns: 44px auto 44px 1fr 44px;
  align-items: center;
  justify-items: center;
  gap: 4px;
  padding: 0 16px calc(env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: rgba(22, 21, 20, 0.92);
  backdrop-filter: blur(10px);
}

.btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background 160ms ease, opacity 160ms ease, color 160ms ease;
}

.btn:hover:not(:disabled) {
  background: var(--btn-hover);
}

.btn:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.28;
  cursor: default;
}

.btn-prev { grid-column: 1; }
.counter {
  grid-column: 2;
  min-width: 7.5ch;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.btn-next { grid-column: 3; }
.btn-fullscreen { grid-column: 5; justify-self: end; }

.btn-fullscreen .icon-exit { display: none; }
.app.is-fullscreen .btn-fullscreen .icon-enter { display: none; }
.app.is-fullscreen .btn-fullscreen .icon-exit { display: block; }

.loader {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg);
  z-index: 20;
  transition: opacity 280ms ease;
}

.loader.is-done {
  opacity: 0;
  pointer-events: none;
}

.loader-mark {
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.loader-bar {
  width: 120px;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}

.loader-bar span {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--ink);
  animation: load 1s ease-in-out infinite;
}

@keyframes load {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

@media (max-width: 700px) {
  :root { --pad: 12px; --toolbar-h: 52px; }
  .counter { font-size: 12px; }
}
