[hidden] { display: none !important; }

.fullscreen-button {
  margin-left: 5px;
  padding: 6px !important;
  background: var(--ink) !important;
  color: white !important;
}
.fullscreen-button svg {
  width: 100%; height: 100%; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.page-turn-mode {
  height: 30px; border: 1px solid var(--line); border-radius: 6px;
  background: white; color: var(--ink); padding: 0 7px; font-size: 11px;
  cursor: pointer; outline: none;
}
.search-result { position: relative; padding-right: 78px; }
.result-fullscreen {
  position: absolute; right: 9px; top: 8px; border: 1px solid var(--line);
  background: var(--ink); color: white; border-radius: 5px;
  padding: 5px 8px; font-size: 11px; cursor: pointer;
}
.stage:fullscreen { width: 100vw; height: 100vh; background: #111; }
.stage:fullscreen.gesture-locked { touch-action: none; overscroll-behavior: none; overflow: hidden; }
.stage:fullscreen.gesture-locked .canvas-scroller { touch-action: none; overscroll-behavior: none; }
.stage:fullscreen .viewer { background: #111; }
.stage:fullscreen .viewer-toolbar { display: none; }
.stage:fullscreen .canvas-scroller {
  padding: 0; background: #111; align-items: flex-start; overflow: hidden; position: relative;
}
.stage:fullscreen .page-surface { transition: opacity .16s ease; }
.page-transition-layer {
  position: absolute; inset: 0; z-index: 30; overflow: hidden;
  background: #111; pointer-events: none;
}
.transition-page {
  position: absolute; left: 50%; transform: translate(-50%,-50%);
  display: flex; align-items: center; justify-content: center;
}
.transition-page canvas { display: block; box-shadow: 0 8px 38px rgba(0,0,0,.3); }
.continuous-viewer { display: none; }
.stage:fullscreen .continuous-viewer:not([hidden]) {
  display: block; position: absolute; inset: 0; overflow-y: auto;
  overflow-x: hidden; background: #111; padding: 22px 0 60px;
  scroll-behavior: auto; overscroll-behavior: contain;
}
.continuous-page {
  position: relative; margin: 0 auto 22px; background: white;
  box-shadow: 0 8px 30px rgba(0,0,0,.35); overflow: hidden;
}
.continuous-page canvas { display: block; width: 100%; height: 100%; }
.continuous-page::before {
  content: attr(data-page-label); position: absolute; right: 10px; bottom: 8px;
  z-index: 2; padding: 3px 7px; border-radius: 4px;
  background: rgba(0,0,0,.5); color: white; font-size: 11px;
}
.continuous-page.rendered::before { opacity: .25; }
.stage:fullscreen .page-surface { box-shadow: none; }
.fullscreen-floating-tools {
  position: absolute; z-index: 90; left: auto; right: 24px; top: 100px; display: none;
  align-items: center; gap: 6px; padding: 7px; border-radius: 14px;
  background: rgba(28,30,29,.92); color: #fff; box-shadow: 0 10px 34px rgba(0,0,0,.4);
  backdrop-filter: blur(12px); touch-action: none; user-select: none; -webkit-user-select: none;
}
.stage:fullscreen .fullscreen-floating-tools:not([hidden]) { display: flex; }
.floating-tool-body { display: flex; align-items: center; gap: 4px; }
.floating-tool,.floating-grip,.floating-collapse,.floating-exit { width: 40px; height: 40px; border: 0; border-radius: 9px; background: transparent; color: #fff; padding: 8px; }
.floating-tool svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.floating-tool.active { background: #f4f1ea; color: #1b1d1c; box-shadow: inset 0 -3px 0 #e4572e; }
.floating-grip { cursor: grab; font-size: 20px; padding: 0; color: #c9c9c9; }
.floating-grip:active { cursor: grabbing; }
.floating-collapse { font-size: 23px; padding: 0; background: rgba(255,255,255,.1); }
.floating-exit { font-size: 24px; padding: 0; background: rgba(228,87,46,.82); }
.floating-color { width: 34px; height: 40px; display: grid; place-items: center; cursor: pointer; }
.floating-color input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.floating-color span { display: block; width: 22px; height: 22px; border-radius: 50%; background: #e4572e; border: 3px solid white; }
.fullscreen-floating-tools.collapsed { width: 52px; height: 52px; padding: 0; border-radius: 50%; gap: 0; }
.fullscreen-floating-tools.collapsed .floating-tool-body,.fullscreen-floating-tools.collapsed .floating-collapse,.fullscreen-floating-tools.collapsed .floating-exit { display: none; }
.fullscreen-floating-tools.collapsed .floating-grip { width: 52px; height: 52px; border-radius: 50%; color: white; font-size: 0; }
.fullscreen-floating-tools.collapsed .floating-grip::after { content: "✎"; font-size: 24px; }

body.presentation-open { overflow: hidden !important; }
.stage.presentation-mode { position: fixed !important; inset: 0; z-index: 1000; width: 100vw; height: 100dvh; background: #111; }
.stage.presentation-mode.gesture-locked { touch-action: none; overscroll-behavior: none; overflow: hidden; }
.stage.presentation-mode.gesture-locked .canvas-scroller { touch-action: none; overscroll-behavior: none; }
.stage.presentation-mode .viewer { background: #111; }
.stage.presentation-mode .viewer-toolbar { display: none; }
.stage.presentation-mode .canvas-scroller { padding: 0; background: #111; align-items: flex-start; overflow: hidden; position: relative; }
.stage.presentation-mode .page-surface { transition: opacity .16s ease; box-shadow: none; }
.stage.presentation-mode .continuous-viewer:not([hidden]) { display: block; position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; background: #111; padding: 22px 0 60px; }
.stage.presentation-mode .fullscreen-floating-tools:not([hidden]) { display: flex; }
