:root {
  color-scheme: dark;
  --bg: #111111;
  --panel: #1a1a1a;
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #f4f4f5;
  --muted: #b4b4bc;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  padding: 18px;
}

.toolbar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  z-index: 10;
}

.control-button {
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 12px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.control-button:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.control-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.icon-button {
  width: 34px;
  min-width: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.viewer-layout {
  flex: 1;
  position: relative;
  display: flex;
}

.viewer-panel {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px 24px 92px;
  background: var(--bg);
  overflow: hidden;
}

.slide-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.slide-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  will-change: transform, opacity, filter;
}

#slideImage {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  height: auto;
  width: auto;
  border-radius: 6px;
  box-shadow: var(--shadow);
  background: white;
}

.link-overlay {
  position: absolute;
  inset: 0;
}

.slide-link {
  position: absolute;
  display: block;
  border-radius: 2px;
  outline: none;
}

.slide-link:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(56, 189, 248, 0.95);
  background: rgba(56, 189, 248, 0.18);
}

.slide-ghost {
  position: absolute;
  top: 50%;
  left: 50%;
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
}

.is-entering-next {
  animation: slide-in-next 560ms cubic-bezier(0.16, 1, 0.3, 1);
}

.is-entering-prev {
  animation: slide-in-prev 560ms cubic-bezier(0.16, 1, 0.3, 1);
}

.is-entering-fade {
  animation: slide-in-fade 440ms cubic-bezier(0.16, 1, 0.3, 1);
}

.is-exiting-next {
  animation: slide-out-next 560ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.is-exiting-prev {
  animation: slide-out-prev 560ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slide-in-next {
  from {
    opacity: 0;
    transform: translateX(28px) scale(0.99);
    filter: blur(6px);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
}

@keyframes slide-in-prev {
  from {
    opacity: 0;
    transform: translateX(-28px) scale(0.99);
    filter: blur(6px);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
}

@keyframes slide-in-fade {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.994);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slide-out-next {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) translateX(0) scale(1);
    filter: blur(0);
  }

  to {
    opacity: 0;
    transform: translate(-50%, -50%) translateX(-34px) scale(0.99);
    filter: blur(7px);
  }
}

@keyframes slide-out-prev {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) translateX(0) scale(1);
    filter: blur(0);
  }

  to {
    opacity: 0;
    transform: translate(-50%, -50%) translateX(34px) scale(0.99);
    filter: blur(7px);
  }
}

.page-indicator {
  min-width: 58px;
  padding: 0 10px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-card {
  padding: 18px 22px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-card.error {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(127, 29, 29, 0.25);
}

.hidden {
  display: none;
}

@media (max-width: 900px) {
  .app-shell {
    padding: 12px;
  }

  .toolbar {
    bottom: 12px;
    width: auto;
    max-width: calc(100% - 24px);
  }

  .viewer-panel {
    padding: 12px 12px 88px;
  }

  #slideImage {
    max-height: calc(100vh - 140px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .slide-frame,
  .slide-ghost {
    animation: none !important;
    transition: none !important;
    filter: none !important;
  }
}
