body {
  background: #f5f6f8;
  color: #1f2937;
}

.auth-panel,
.upload-panel,
.empty-state {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.auth-panel {
  max-width: 420px;
}

.doc-name {
  max-width: 460px;
}

.attach-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.user-actions {
  display: inline-grid;
  gap: 8px;
  justify-items: end;
}

@media (max-width: 760px) {
  .container-fluid {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .table {
    min-width: 680px;
  }
}

.viewer-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: calc(100vh - 57px);
}

.viewer-sidebar {
  position: sticky;
  top: 57px;
  height: calc(100vh - 57px);
  overflow-y: auto;
}

.viewer-main {
  min-width: 0;
}

.toolbar {
  position: sticky;
  top: 57px;
  z-index: 2;
}

.page-stage {
  min-height: calc(100vh - 106px);
  padding: 24px;
  overflow: auto;
}

.page-frame {
  width: fit-content;
  min-width: 320px;
  min-height: 420px;
  margin: 0 auto;
  position: relative;
}

.page-image {
  display: block;
  max-width: none;
  width: min(var(--page-width, 900px), calc(100vw - 360px));
  height: auto;
  background: #fff;
  box-shadow: 0 12px 38px rgba(15, 23, 42, 0.18);
}

#loading {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

@media (max-width: 860px) {
  .viewer-shell {
    display: block;
  }

  .viewer-sidebar {
    position: static;
    height: auto;
  }

  .toolbar {
    top: 57px;
  }

  .page-stage {
    min-height: auto;
    padding: 16px;
  }

  .page-image {
    width: min(var(--page-width, 900px), calc(100vw - 32px));
  }
}
